aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-10 15:53:47 +0200
committervan Hauser <vh@thc.org>2020-05-10 15:53:47 +0200
commit26fe7a9d669448ed8711c575aecd452ce0fcb00a (patch)
tree19263144989da10487d0ace5ff67aef4d0b5cbe4
parent07a0e2caf77c0b7560a2344fe25e197782ad2d9d (diff)
downloadafl++-26fe7a9d669448ed8711c575aecd452ce0fcb00a.tar.gz
final code-format fixes, remove test-multiple-mutators when done
-rw-r--r--include/alloc-inl.h84
-rwxr-xr-xtest/test.sh1
2 files changed, 40 insertions, 45 deletions
diff --git a/include/alloc-inl.h b/include/alloc-inl.h
index 7279c323..a8483a9e 100644
--- a/include/alloc-inl.h
+++ b/include/alloc-inl.h
@@ -249,23 +249,21 @@ static inline u8 *DFL_ck_memdup_str(u8 *mem, u32 size) {
/* Macro to enforce allocation limits as a last-resort defense against
integer overflows. */
-#define ALLOC_CHECK_SIZE(_s) \
- do { \
- \
- if ((_s) > MAX_ALLOC) ABORT("Bad alloc request: %u bytes", (_s));
-
-}
-
-while (0)
+#define ALLOC_CHECK_SIZE(_s) \
+ do { \
+ \
+ if ((_s) > MAX_ALLOC) ABORT("Bad alloc request: %u bytes", (_s)); \
+ \
+ } while (0)
/* Macro to check malloc() failures and the like. */
-#define ALLOC_CHECK_RESULT(_r, _s) \
- do { \
- \
- if (!(_r)) ABORT("Out of memory: can't allocate %u bytes", (_s));
-
-}
+#define ALLOC_CHECK_RESULT(_r, _s) \
+ do { \
+ \
+ if (!(_r)) ABORT("Out of memory: can't allocate %u bytes", (_s)); \
+ \
+ }
while (0)
@@ -290,38 +288,34 @@ while (0)
/* Sanity-checking macros for pointers. */
-#define CHECK_PTR(_p) \
- do { \
- \
- if (_p) { \
- \
- if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) { \
- \
- if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
- ABORT("Use after free."); \
- else \
- ABORT("Corrupted head alloc canary.");
-
-}
-
-if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) ABORT("Corrupted tail alloc canary.");
-
-}
-
-}
-
-while (0)
-
-#define CHECK_PTR_EXPR(_p) \
- ({ \
- \
- \
- \
- typeof(_p) _tmp = (_p); \
- CHECK_PTR(_tmp); \
- _tmp;
+#define CHECK_PTR(_p) \
+ do { \
+ \
+ if (_p) { \
+ \
+ if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) { \
+ \
+ if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
+ ABORT("Use after free."); \
+ else \
+ ABORT("Corrupted head alloc canary."); \
+ \
+ } \
+ if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) \
+ ABORT("Corrupted tail alloc canary."); \
+ \
+ } \
+ \
+ } while (0)
-})
+#define CHECK_PTR_EXPR(_p) \
+ ({ \
+ \
+ typeof(_p) _tmp = (_p); \
+ CHECK_PTR(_tmp); \
+ _tmp; \
+ \
+ })
/* Allocate a buffer, explicitly not zeroing it. Returns NULL for zero-sized
requests. */
diff --git a/test/test.sh b/test/test.sh
index 1caa9985..919d7a9c 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -1039,6 +1039,7 @@ test "1" = "`../afl-fuzz | grep -i 'without python' >/dev/null; echo $?`" && {
# Clean
rm -rf in out errors
rm -rf ${CUSTOM_MUTATOR_PATH}/__pycache__/
+ rm -f test-multiple-mutators
} || {
ls .
ls ${CUSTOM_MUTATOR_PATH}