LOG_FATAL
- Macro
- August 22, 2025
Table of Contents
LOG_FATAL
LOG_FATAL
Description
Writes a fatal log message and aborts the program. …[in] : Format string and arguments following printf-style syntax.
Success
Message logged and program aborted via abort()
Failure
Logging may fail silently, but abort() will still execute
Usage example (Cross-references)
- In
Foreach.h:40
:
{ body } \
if ((idx) >= (bv)->length) { \
LOG_FATAL("BitVec range overflow : Invalid index reached during Foreach iteration."); \
} \
} \
- In
Foreach.h:66
:
{ body } \
if ((idx) >= (bv)->length) { \
LOG_FATAL("BitVec range overflow : Invalid index reached during Foreach reverse iteration."); \
} \
if (idx == 0) \
- In
Foreach.h:137
:
if ((bv)->length > 0) { \
if ((_e) > (bv)->length) { \
LOG_FATAL( \
"BitVec range overflow: End index {} exceeds bitvector length {}. " \
"If you intended to iterate over all bits, use BitVecForeach instead.", \
- In
Foreach.h:145
:
} \
if ((_s) >= (bv)->length) { \
LOG_FATAL( \
"BitVec range overflow: Start index {} exceeds or equals bitvector length {}.", \
_s, \
- In
Foreach.h:152
:
} \
if ((_s) > (_e)) { \
LOG_FATAL("Invalid range: Start index {} must be less than or equal to end index {}.", _s, _e); \
} \
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
- In
Foreach.h:156
:
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
if ((idx) >= (bv)->length) { \
LOG_FATAL( \
"BitVec range overflow: Index {} exceeds bitvector length {} during iteration.", \
idx, \
- In
Foreach.h:37
:
{ body } \
if ((idx) >= (v)->length) { \
LOG_FATAL("Vector range overflow : Invalid index reached during Foreach iteration."); \
} \
} \
- In
Foreach.h:64
:
{ body } \
if ((idx) >= (v)->length) { \
LOG_FATAL("Vector range overflow : Invalid index reached during Foreach reverse iteration."); \
} \
if (idx == 0) \
- In
Foreach.h:92
:
var = VecPtrAt(v, idx); \
body if ((idx) >= (v)->length) { \
LOG_FATAL("Vector range overflow : Invalid index reached during Foreach iteration."); \
} \
} \
- In
Foreach.h:119
:
{ body } \
if ((idx) >= (v)->length) { \
LOG_FATAL("Vector range overflow : Invalid index reached during Foreach reverse iteration."); \
} \
if (idx == 0) \
- In
Foreach.h:235
:
if ((v)->length > 0) { \
if ((_e) > (v)->length) { \
LOG_FATAL( \
"Vector range overflow: End index %zu exceeds vector length %zu. " \
"If you intended to iterate over all items, use VecForeach instead.", \
- In
Foreach.h:243
:
} \
if ((_s) >= (v)->length) { \
LOG_FATAL( \
"Vector range overflow: Start index %zu exceeds or equals vector length %zu.", \
_s, \
- In
Foreach.h:250
:
} \
if ((_s) > (_e)) { \
LOG_FATAL("Invalid range: Start index %zu must be less than or equal to end index %zu.", _s, _e); \
} \
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
- In
Foreach.h:254
:
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
if ((idx) >= (v)->length) { \
LOG_FATAL( \
"Vector range overflow: Index %zu exceeds vector length %zu during iteration.", \
idx, \
- In
Foreach.h:314
:
if ((v)->length > 0) { \
if ((_e) > (v)->length) { \
LOG_FATAL( \
"Vector range overflow: End index {} exceeds vector length {}. " \
"If you intended to iterate over all items, use VecForeach instead.", \
- In
Foreach.h:322
:
} \
if ((_s) >= (v)->length) { \
LOG_FATAL( \
"Vector range overflow: Start index {} exceeds or equals vector length {}.", \
_e, \
- In
Foreach.h:329
:
} \
if ((_s) > (_e)) { \
LOG_FATAL("Invalid range: Start index {} must be less than or equal to end index {}.", _s, _e); \
} \
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
- In
Foreach.h:333
:
for ((idx) = (_s); (idx) < (_e); ++(idx)) { \
if ((idx) >= (v)->length) { \
LOG_FATAL( \
"Vector range overflow: Index {} exceeds vector length {} during iteration.", \
idx, \
- In
Insert.h:193
:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
const VEC_DATATYPE(v) __x = *(varr); \
- In
Insert.h:229
:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
const VEC_DATATYPE(v) __x = *(varr); \
- In
Insert.h:287
:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
const VEC_DATATYPE(v) __x = *(varr); \
- In
Insert.h:325
:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
const VEC_DATATYPE(v) __x = *(varr); \
- In
Memory.c:12
:
i32 MemCompare(const void* p1, const void* p2, size n) {
if (!p1 || !p2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:29
:
void* MemCopy(void* dst, const void* src, size n) {
if (!dst || !src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:42
:
void* MemMove(void* dst, const void* src, size n) {
if (!dst || !src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:63
:
void* MemSet(void* dst, i32 val, size n) {
if (!dst) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:75
:
size ZstrLen(const char* str) {
if (!str) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:86
:
i32 ZstrCompare(const char* s1, const char* s2) {
if (!s1 || !s2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:98
:
i32 ZstrCompareN(const char* s1, const char* s2, size n) {
if (!s1 || !s2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:121
:
char* ZstrDupN(const char* src, size n) {
if (!src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:143
:
char* ZstrFindSubstring(const char* haystack, const char* needle) {
if (!haystack || !needle) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:168
:
char* ZstrFindSubstringN(const char* haystack, const char* needle, size needle_len) {
if (!haystack || !needle) {
LOG_FATAL("Invalid arguments");
}
- In
File.c:37
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_FATAL("malloc() failed : {}", syserr);
});
}
- In
Io.c:71
:
static bool ParseFormatSpec(const char* spec, u32 len, FmtInfo* fi) {
if (!spec || !fi) {
LOG_FATAL("Invalid arguments to ParseFormatSpec");
return false;
}
- In
Io.c:219
:
bool StrWriteFmtInternal(Str* o, const char* fmt, TypeSpecificIO* args, size argc) {
if (!o || !fmt) {
LOG_FATAL("Invalid arguments");
return false;
}
- In
Io.c:279
:
}
#else
LOG_FATAL("Invalid writer or data pointer");
#endif
}
- In
Io.c:397
:
const char* StrReadFmtInternal(const char* input, const char* fmtstr, TypeSpecificIO* argv, size argc) {
if (!input || !fmtstr) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:594
:
void FReadFmtInternal(FILE* file, const char* fmtstr, TypeSpecificIO* argv, size argc) {
if (!file || !fmtstr) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:649
:
static inline void write_int_as_chars(Str* o, FormatFlags flags, u64 value, size num_bytes) {
if (!o || !num_bytes || num_bytes > 8) {
LOG_FATAL("Invalid arguments to write_int_as_chars");
}
- In
Io.c:684
:
static inline void write_char_internal(Str* o, FormatFlags flags, const char* vs, size len) {
if (!o || !vs || !len) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:726
:
static inline const char* read_chars_internal(const char* i, u8* buffer, size buffer_size, FmtInfo* fmt_info) {
if (!i || !buffer || !buffer_size) {
LOG_FATAL("Invalid arguments to read_chars_internal");
}
- In
Io.c:778
:
void _write_Str(Str* o, FmtInfo* fmt_info, Str* s) {
if (!o || !s || !fmt_info) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:846
:
void _write_Zstr(Str* o, FmtInfo* fmt_info, const char** s) {
if (!o || !s || !*s || !fmt_info) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:919
:
void _write_u64(Str* o, FmtInfo* fmt_info, u64* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:963
:
void _write_u32(Str* o, FmtInfo* fmt_info, u32* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:979
:
void _write_u16(Str* o, FmtInfo* fmt_info, u16* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:995
:
void _write_u8(Str* o, FmtInfo* fmt_info, u8* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1011
:
void _write_i64(Str* o, FmtInfo* fmt_info, i64* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1055
:
void _write_i32(Str* o, FmtInfo* fmt_info, i32* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1071
:
void _write_i16(Str* o, FmtInfo* fmt_info, i16* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1087
:
void _write_i8(Str* o, FmtInfo* fmt_info, i8* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1103
:
void _write_f64(Str* o, FmtInfo* fmt_info, f64* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1166
:
void _write_f32(Str* o, FmtInfo* fmt_info, f32* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1253
:
const char* _read_Str(const char* i, FmtInfo* fmt_info, Str* s) {
if (!i || !s)
LOG_FATAL("Invalid arguments");
ValidateStr(s);
- In
Io.c:1515
:
const char* _read_f64(const char* i, FmtInfo* fmt_info, f64* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1623
:
const char* _read_u8(const char* i, FmtInfo* fmt_info, u8* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Skip whitespace
- In
Io.c:1696
:
const char* _read_u16(const char* i, FmtInfo* fmt_info, u16* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1771
:
const char* _read_u32(const char* i, FmtInfo* fmt_info, u32* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1845
:
const char* _read_u64(const char* i, FmtInfo* fmt_info, u64* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1911
:
const char* _read_i8(const char* i, FmtInfo* fmt_info, i8* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1985
:
const char* _read_i16(const char* i, FmtInfo* fmt_info, i16* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2060
:
const char* _read_i32(const char* i, FmtInfo* fmt_info, i32* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2135
:
const char* _read_i64(const char* i, FmtInfo* fmt_info, i64* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2202
:
(void)fmt_info; // Unused parameter
if (!i || !out)
LOG_FATAL("Invalid arguments");
// For string types, :c has no effect - work like regular string reading
- In
Io.c:2233
:
void _write_BitVec(Str* o, FmtInfo* fmt_info, BitVec* bv) {
if (!o || !fmt_info || !bv) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:2284
:
(void)fmt_info;
(void)s;
LOG_FATAL("Attempt to write unsupported type");
}
- In
Io.c:2290
:
(void)fmt_info; // Unused parameter
if (!i || !bv) {
LOG_FATAL("Invalid arguments");
return i;
}
- In
Io.c:2406
:
(void)fmt_info; // Unused parameter
(void)s;
LOG_FATAL("Attempt to read unsupported type.");
return i;
}
- In
Io.c:2412
:
const char* _read_f32(const char* i, FmtInfo* fmt_info, f32* v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2524
:
static void _write_r8(Str* o, FmtInfo* fmt_info, u8* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2532
:
static void _write_r16(Str* o, FmtInfo* fmt_info, u16* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2554
:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:2561
:
static void _write_r32(Str* o, FmtInfo* fmt_info, u32* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2588
:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:2596
:
static void _write_r64(Str* o, FmtInfo* fmt_info, u64* v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2630
:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:2637
:
static const char* _read_r8(const char* i, FmtInfo* fmt_info, u8* v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2649
:
static const char* _read_r16(const char* i, FmtInfo* fmt_info, u16* v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r16");
}
- In
Io.c:2669
:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r16.");
}
- In
Io.c:2679
:
static const char* _read_r32(const char* i, FmtInfo* fmt_info, u32* v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r32");
}
- In
Io.c:2698
:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r32.");
}
- In
Io.c:2708
:
static const char* _read_r64(const char* i, FmtInfo* fmt_info, u64* v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r64");
}
- In
Io.c:2729
:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r64.");
}
- In
Iter.c:21
:
}
} else {
LOG_FATAL("Invalid direction");
return 0;
}
- In
Iter.c:28
:
void validate_iter(GenericIter *i) {
if (((i)->dir != -1 && (i)->dir != 1) || !(i)->alignment || !(i)->length || (i)->pos >= (i)->length) {
LOG_FATAL("Invalid iter object.");
}
(void)(*(char *)(void *)((i)->data));
- In
BitVec.c:94
:
if (!new_data) {
LOG_FATAL("Failed to allocate memory for bitvec");
return;
}
- In
BitVec.c:189
:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:200
:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:215
:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:237
:
ValidateBitVec(bitvec);
if (bitvec->length == 0) {
LOG_FATAL("Cannot pop from empty bitvector");
}
bool value = BitVecGet(bitvec, bitvec->length - 1);
- In
BitVec.c:247
:
ValidateBitVec(bitvec);
if (idx > bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
// For now, implement as push + manual bit shifting (simple but not efficient)
- In
BitVec.c:264
:
ValidateBitVec(bv);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (count == 0) {
- In
BitVec.c:291
:
ValidateBitVec(other);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (other->length == 0) {
- In
BitVec.c:318
:
ValidateBitVec(bv);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (pattern_bits == 0 || pattern_bits > 8) {
- In
BitVec.c:345
:
ValidateBitVec(bv);
if (idx >= bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
- In
BitVec.c:364
:
ValidateBitVec(bv);
if (idx >= bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (count == 0) {
- In
BitVec.c:528
:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {
- In
BitVec.c:531
:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}
- In
BitVec.c:570
:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {
- In
BitVec.c:573
:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}
- In
BitVec.c:746
:
BitVec BitVecFromStr(const char *str) {
if (!str) {
LOG_FATAL("str is NULL");
}
- In
BitVec.c:769
:
ValidateBitVec(bv);
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
if (max_len == 0) {
- In
BitVec.c:772
:
}
if (max_len == 0) {
LOG_FATAL("max_len is 0");
}
if (bv->length == 0) {
- In
BitVec.c:798
:
BitVec BitVecFromBytes(const u8 *bytes, u64 bit_len) {
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
- In
BitVec.c:1093
:
if (!results || max_results == 0) {
LOG_FATAL("results is NULL or max_results is 0");
}
- In
BitVec.c:1117
:
ValidateBitVec(bv);
if (!runs || !values || max_runs == 0) {
LOG_FATAL("invalid arguments");
}
- In
BitVec.c:1264
:
if (curr_row)
free(curr_row);
LOG_FATAL("Memory allocation failed");
}
- In
BitVec.c:1590
:
ValidateBitVec(bv);
if (!pattern) {
LOG_FATAL("pattern is NULL");
}
- In
BitVec.c:1613
:
ValidateBitVec(bv);
if (!patterns) {
LOG_FATAL("invalid BitVecs object provided");
}
- In
BitVec.c:1628
:
ValidateBitVec(bv);
if (!patterns) {
LOG_FATAL("invalid arguments");
}
- In
BitVec.c:1642
:
void ValidateBitVec(const BitVec *bv) {
if (!(bv)) {
LOG_FATAL("Invalid bitvec object: NULL.");
}
if ((bv)->length > (bv)->capacity) {
- In
BitVec.c:1645
:
}
if ((bv)->length > (bv)->capacity) {
LOG_FATAL("Invalid bitvec object: length > capacity.");
}
if ((bv)->length > 0 && !(bv)->data) {
- In
BitVec.c:1648
:
}
if ((bv)->length > 0 && !(bv)->data) {
LOG_FATAL("Invalid bitvec object: length > 0 but data is NULL.");
}
if ((bv)->capacity > 0 && (bv)->byte_size * 8 < (bv)->capacity) {
- In
BitVec.c:1651
:
}
if ((bv)->capacity > 0 && (bv)->byte_size * 8 < (bv)->capacity) {
LOG_FATAL("Invalid bitvec object: byte_u64 too small for capacity.");
}
if ((bv)->data) {
- In
Vec.c:24
:
if (!v->alignment) {
LOG_FATAL("Invalid alignment. Did you initialize before use? Aborting...");
}
- In
Vec.c:93
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_FATAL("realloc() failed : {}", syserr);
});
}
- In
Vec.c:142
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_FATAL("realloc() failed : {}", syserr);
});
}
- In
Vec.c:155
:
if (idx > vec->length) {
LOG_FATAL("vector index out of bounds, insertion at index greater than length");
}
- In
Vec.c:189
:
if (idx > vec->length) {
LOG_FATAL("vector index out of bounds, insertion at index greater than length");
}
- In
Vec.c:225
:
if (start + count > vec->length) {
LOG_FATAL("vector range out of bounds.");
}
- In
Vec.c:266
:
if (start + count > vec->length) {
LOG_FATAL("vector range out of bounds.");
}
- In
Vec.c:320
:
if (vec_aligned_size(vec, item_size) != item_size) {
LOG_FATAL(
"QSort not implemented for vectors wherein the size of items don't "
"match their aligned size."
- In
Vec.c:334
:
if (idx1 >= vec->length || idx2 >= vec->length) {
LOG_FATAL("vector index out of bounds.");
}
- In
Vec.c:381
:
void validate_vec(const GenericVec *v) {
if (!(v)) {
LOG_FATAL("NULL vec object pointer.");
}
if (!(v)->alignment || (v)->length > (v)->capacity) {
- In
Vec.c:384
:
}
if (!(v)->alignment || (v)->length > (v)->capacity) {
LOG_FATAL("Invalid vec object.");
}
// if memory is invalid, system will segfault here
- In
ElfInfo.c:336
:
int main(int argc, char** argv) {
if (argc < 2) {
LOG_FATAL("USAGE: {} {}", argv[0], argv[1]);
}
- In
ElfInfo.c:355
:
// for an invalid elf magic, any subsequent fields will be zero, and hence will be invalid
if (eh.meta.class != ELF_CLASS_64) {
LOG_FATAL("Only 64-bit binaries supported for now. Class for provided binary is = {}", eh.meta.class);
}
- In
MisraDoc.c:113
:
Scope(&config, StrDeinit, {
if (!ReadCompleteFile(config_path, &config.data, &config.length, &config.capacity)) {
LOG_FATAL("Failed to read config file.");
}
StrIter json = StrIterFromStr(config);
BitVecPush(&pattern, true);
BitVecFindPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindLastPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindLastPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
// Don't create pattern BitVec since we're testing NULL source validation
BitVecFindAllPattern(NULL, (BitVec *)0x1, results, 10); // Should cause LOG_FATAL
return true;
BitVecPush(&source, false);
BitVecFindAllPattern(&source, NULL, results, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, NULL, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, results, 0); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindLastPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindLastPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
// Don't create pattern BitVec since we're testing NULL source validation
BitVecFindAllPattern(NULL, (BitVec *)0x1, results, 10); // Should cause LOG_FATAL
return true;
BitVecPush(&source, false);
BitVecFindAllPattern(&source, NULL, results, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, NULL, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, results, 0); // Should cause LOG_FATAL
BitVecDeinit(&source);