about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-05-15 17:07:30 +0200
committerhexcoder- <heiko@hexco.de>2020-05-15 17:07:30 +0200
commit2b922e9e684b51c04c7311ed6fca1334b43b54f6 (patch)
treecd2ad0455770b5ae5ff702653b8e6a8a904139d7
parent57637ba0b0981a7e2ebd407fc04a619f4120fb62 (diff)
downloadafl++-2b922e9e684b51c04c7311ed6fca1334b43b54f6.tar.gz
fix possible null ptr deref in afl-prealloc.h
-rw-r--r--include/afl-prealloc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/afl-prealloc.h b/include/afl-prealloc.h
index 66e6aadf..5e5d7b85 100644
--- a/include/afl-prealloc.h
+++ b/include/afl-prealloc.h
@@ -61,6 +61,7 @@ typedef enum prealloc_status {
     if ((prealloc_counter) >= (prealloc_size)) {                               \
                                                                                \
       el_ptr = malloc(sizeof(*el_ptr));                                        \
+      if (!el_ptr) { FATAL("error in list.h -> out of memory for element!"); } \
       el_ptr->pre_status = PRE_STATUS_MALLOC;                                  \
                                                                                \
     } else {                                                                   \