mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
fix asserts
This commit is contained in:
@ -457,8 +457,8 @@ u8 *describe_op(afl_state_t *afl, u8 new_bits, size_t max_description_len) {
|
|||||||
ret[len_current++] = ',';
|
ret[len_current++] = ',';
|
||||||
ret[len_current] = '\0';
|
ret[len_current] = '\0';
|
||||||
|
|
||||||
size_t size_left = real_max_len - len_current - strlen(",+cov") - 2;
|
ssize_t size_left = real_max_len - len_current - strlen(",+cov") - 2;
|
||||||
assert(size_left > 0);
|
if (unlikely(size_left <= 0)) FATAL("filename got too long");
|
||||||
|
|
||||||
const char *custom_description =
|
const char *custom_description =
|
||||||
afl->current_custom_fuzz->afl_custom_describe(
|
afl->current_custom_fuzz->afl_custom_describe(
|
||||||
@ -505,7 +505,8 @@ u8 *describe_op(afl_state_t *afl, u8 new_bits, size_t max_description_len) {
|
|||||||
|
|
||||||
if (new_bits == 2) { strcat(ret, ",+cov"); }
|
if (new_bits == 2) { strcat(ret, ",+cov"); }
|
||||||
|
|
||||||
assert(strlen(ret) <= max_description_len);
|
if (unlikely(strlen(ret) >= max_description_len))
|
||||||
|
FATAL("describe string is too long");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
|
||||||
__attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv);
|
__attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv);
|
||||||
|
|
||||||
#define kMaxAflInputSize (1 * 1024 * 1024);
|
#define kMaxAflInputSize (1 * 1024 * 1024)
|
||||||
static uint8_t AflInputBuf[kMaxAflInputSize];
|
static uint8_t AflInputBuf[kMaxAflInputSize];
|
||||||
|
|
||||||
void __attribute__((noinline)) afl_qemu_driver_stdin_input(void) {
|
void __attribute__((noinline)) afl_qemu_driver_stdin_input(void) {
|
||||||
|
Reference in New Issue
Block a user