mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
more fixes, leaks and compile errors
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Written mostly by meme -> https://github.com/meme/hotwax
|
Written mostly by meme -> https://github.com/meme/hotwax
|
||||||
|
|
||||||
Modificationy by Marc Heuse <mh@mh-sec.de>
|
Modifications by Marc Heuse <mh@mh-sec.de>
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#define BUF_VAR(type, name) \
|
#define BUF_VAR(type, name) \
|
||||||
type * name##_buf; \
|
type * name##_buf; \
|
||||||
size_t name##_size;
|
size_t name##_size;
|
||||||
/* this filles in `&structptr->something_buf, &structptr->something_size`. */
|
/* this fills in `&structptr->something_buf, &structptr->something_size`. */
|
||||||
#define BUF_PARAMS(struct, name) \
|
#define BUF_PARAMS(struct, name) \
|
||||||
(void **)&struct->name##_buf, &struct->name##_size
|
(void **)&struct->name##_buf, &struct->name##_size
|
||||||
|
|
||||||
|
@ -94,7 +94,13 @@ void *afl_custom_init(void *afl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
state->buf = calloc(sizeof(unsigned char), 4096);
|
state->buf = calloc(sizeof(unsigned char), 4096);
|
||||||
if (!state->buf) { return NULL; }
|
if (!state->buf) {
|
||||||
|
|
||||||
|
free(state);
|
||||||
|
perror("calloc");
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
|
@ -54,7 +54,13 @@ void *afl_custom_init(void *afl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
state->buf = calloc(sizeof(unsigned char), 4096);
|
state->buf = calloc(sizeof(unsigned char), 4096);
|
||||||
if (!state->buf) { return NULL; }
|
if (!state->buf) {
|
||||||
|
|
||||||
|
free(state);
|
||||||
|
perror("calloc");
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifndef _FIXED_CHAR
|
#ifndef _FIXED_CHAR
|
||||||
#define 0x41
|
#define _FIXED_CHAR 0x41
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct my_mutator {
|
typedef struct my_mutator {
|
||||||
|
@ -26,6 +26,7 @@ int main(int argc, char **argv) {
|
|||||||
FILE *f = fopen(argv[1], "r");
|
FILE *f = fopen(argv[1], "r");
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
fread(buf, 1, 4096, f);
|
fread(buf, 1, 4096, f);
|
||||||
|
fclose(f);
|
||||||
uint32_t offset = buf[100] + (buf[101] << 8);
|
uint32_t offset = buf[100] + (buf[101] << 8);
|
||||||
char test_val = buf[offset];
|
char test_val = buf[offset];
|
||||||
return test_val < 100;
|
return test_val < 100;
|
||||||
|
@ -123,7 +123,7 @@ void __afl_trace(const u32 x) {
|
|||||||
u8 c = __builtin_add_overflow(*p, 1, p);
|
u8 c = __builtin_add_overflow(*p, 1, p);
|
||||||
*p += c;
|
*p += c;
|
||||||
#else
|
#else
|
||||||
*p += 1 + ((u8)(1 + *p == 0);
|
*p += 1 + ((u8)(1 + *p) == 0);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
++*p;
|
++*p;
|
||||||
|
Reference in New Issue
Block a user