about summary refs log tree commit diff
path: root/libdislocator/libdislocator.so.c
diff options
context:
space:
mode:
authorDavid Mendenhall <dpmendenhall@gmail.com>2020-04-20 15:00:48 -0700
committerDavid Mendenhall <dpmendenhall@gmail.com>2020-04-20 15:00:48 -0700
commit441b64b467e17d62056c3cf7eae9e9a381644db7 (patch)
tree19c634f1555ff6af5fa9ad09b30cc77f9668cb6d /libdislocator/libdislocator.so.c
parente6fccdd9c1804e66db13e4b0d5faccc5a83d4116 (diff)
downloadafl++-441b64b467e17d62056c3cf7eae9e9a381644db7.tar.gz
add NULL check to malloc_usable_size
Diffstat (limited to 'libdislocator/libdislocator.so.c')
-rw-r--r--libdislocator/libdislocator.so.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdislocator/libdislocator.so.c b/libdislocator/libdislocator.so.c
index 72d280e6..19e84d9f 100644
--- a/libdislocator/libdislocator.so.c
+++ b/libdislocator/libdislocator.so.c
@@ -466,7 +466,7 @@ void *reallocarray(void *ptr, size_t elem_len, size_t elem_cnt) {
 
 size_t malloc_usable_size(void *ptr) {
 
-   return PTR_L(ptr);
+   return ptr ? PTR_L(ptr) : 0;
 
 }