about summary refs log tree commit diff
path: root/src/afl-fuzz-python.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-08-03 11:08:10 +0200
committerGitHub <noreply@github.com>2022-08-03 11:08:10 +0200
commita2f3c3ee519c19935039d1fe1e8b77cdc32fa375 (patch)
tree3a0007a3e8a07b58c4bef927d9c52e0043aa8466 /src/afl-fuzz-python.c
parentc57988e672634ee98048eba6432cc1f4e377e07c (diff)
parent6056d4b140f0665c6a701cada9166379be3435ac (diff)
downloadafl++-a2f3c3ee519c19935039d1fe1e8b77cdc32fa375.tar.gz
Merge pull request #1478 from AFLplusplus/dev
Push to stable
Diffstat (limited to 'src/afl-fuzz-python.c')
-rw-r--r--src/afl-fuzz-python.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/afl-fuzz-python.c b/src/afl-fuzz-python.c
index a3d864c3..a43d80bb 100644
--- a/src/afl-fuzz-python.c
+++ b/src/afl-fuzz-python.c
@@ -535,7 +535,16 @@ size_t post_process_py(void *py_mutator, u8 *buf, size_t buf_size,
 
     Py_DECREF(py_value);
 
-    *out_buf = (u8 *)py->post_process_buf.buf;
+    if (unlikely(py->post_process_buf.len == 0)) {
+
+      *out_buf = NULL;
+
+    } else {
+
+      *out_buf = (u8 *)py->post_process_buf.buf;
+
+    }
+
     return py->post_process_buf.len;
 
   } else {