mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-21 05:42:12 +00:00
hopefully final fixes from code-format disaster :-(
This commit is contained in:
@ -237,6 +237,7 @@ static inline u8 *DFL_ck_memdup_str(u8 *mem, u32 size) {
|
|||||||
({ \
|
({ \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
|
\
|
||||||
u8 *_tmp; \
|
u8 *_tmp; \
|
||||||
s32 _len = snprintf(NULL, 0, _str); \
|
s32 _len = snprintf(NULL, 0, _str); \
|
||||||
if (_len < 0) FATAL("Whoa, snprintf() fails?!"); \
|
if (_len < 0) FATAL("Whoa, snprintf() fails?!"); \
|
||||||
@ -315,6 +316,7 @@ while (0)
|
|||||||
({ \
|
({ \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
|
\
|
||||||
typeof(_p) _tmp = (_p); \
|
typeof(_p) _tmp = (_p); \
|
||||||
CHECK_PTR(_tmp); \
|
CHECK_PTR(_tmp); \
|
||||||
_tmp;
|
_tmp;
|
||||||
|
@ -45,11 +45,9 @@
|
|||||||
do { \
|
do { \
|
||||||
\
|
\
|
||||||
ssize_t rd = syscall(__NR_getrandom, p, l, 0); \
|
ssize_t rd = syscall(__NR_getrandom, p, l, 0); \
|
||||||
if (rd != l) DEBUGF("getrandom failed");
|
if (rd != l) DEBUGF("getrandom failed"); \
|
||||||
|
\
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
while (0)
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -60,11 +58,9 @@ while (0)
|
|||||||
u32 i; \
|
u32 i; \
|
||||||
u8 *ptr = (u8 *)p; \
|
u8 *ptr = (u8 *)p; \
|
||||||
for (i = 0; i < l; i++) \
|
for (i = 0; i < l; i++) \
|
||||||
ptr[i] = rand() % INT_MAX;
|
ptr[i] = rand() % INT_MAX; \
|
||||||
|
\
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
while (0)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -74,13 +70,13 @@ while (0)
|
|||||||
|
|
||||||
#if __STDC_VERSION__ < 201112L || \
|
#if __STDC_VERSION__ < 201112L || \
|
||||||
(defined(__FreeBSD__) && __FreeBSD_version < 1200000)
|
(defined(__FreeBSD__) && __FreeBSD_version < 1200000)
|
||||||
// use this hack if not C11
|
// use this hack if not C11
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
||||||
long long __ll;
|
long long __ll;
|
||||||
long double __ld;
|
long double __ld;
|
||||||
|
|
||||||
} max_align_t;
|
} max_align_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -96,7 +92,7 @@ while (0)
|
|||||||
|
|
||||||
#define SUPER_PAGE_SIZE 1 << 21
|
#define SUPER_PAGE_SIZE 1 << 21
|
||||||
|
|
||||||
/* Error / message handling: */
|
/* Error / message handling: */
|
||||||
|
|
||||||
#define DEBUGF(_x...) \
|
#define DEBUGF(_x...) \
|
||||||
do { \
|
do { \
|
||||||
@ -129,11 +125,11 @@ while (0)
|
|||||||
\
|
\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Macro to count the number of pages needed to store a buffer: */
|
/* Macro to count the number of pages needed to store a buffer: */
|
||||||
|
|
||||||
#define PG_COUNT(_l) (((_l) + (PAGE_SIZE - 1)) / PAGE_SIZE)
|
#define PG_COUNT(_l) (((_l) + (PAGE_SIZE - 1)) / PAGE_SIZE)
|
||||||
|
|
||||||
/* Canary & clobber bytes: */
|
/* Canary & clobber bytes: */
|
||||||
|
|
||||||
#define ALLOC_CANARY 0xAACCAACC
|
#define ALLOC_CANARY 0xAACCAACC
|
||||||
#define ALLOC_CLOBBER 0xCC
|
#define ALLOC_CLOBBER 0xCC
|
||||||
|
Reference in New Issue
Block a user