about summary refs log tree commit diff
path: root/examples/afl_network_proxy/afl-network-server.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-08-31 20:34:28 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-08-31 20:34:28 +0200
commit8ca4414d70df515b504beefddcc3ad3615a4216a (patch)
treeca8a552d322f4b2d79a9feff01f870e891813207 /examples/afl_network_proxy/afl-network-server.c
parent6090bb1bca81229a4c6ae178e1cef0e35bd31a96 (diff)
parenta552631d3b04da880f18a25860169ac4ccd8f85b (diff)
downloadafl++-8ca4414d70df515b504beefddcc3ad3615a4216a.tar.gz
merge conflicts
Diffstat (limited to 'examples/afl_network_proxy/afl-network-server.c')
-rw-r--r--examples/afl_network_proxy/afl-network-server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/afl_network_proxy/afl-network-server.c b/examples/afl_network_proxy/afl-network-server.c
index c70fd47d..75eb3d20 100644
--- a/examples/afl_network_proxy/afl-network-server.c
+++ b/examples/afl_network_proxy/afl-network-server.c
@@ -74,6 +74,7 @@ static u8 *in_data;                    /* Input data for trimming           */
 static u8 *buf2;
 
 static s32 in_len;
+static s32 buf2_len;
 static u32 map_size = MAP_SIZE;
 
 static volatile u8 stop_soon;          /* Ctrl-C pressed?                   */
@@ -381,6 +382,7 @@ int recv_testcase(int s, void **buf) {
     if (clen < 1)
       FATAL("did not receive valid compressed len information: %u", clen);
     buf2 = afl_realloc((void **)&buf2, clen);
+    buf2_len = clen;
     if (unlikely(!buf2)) { PFATAL("Alloc"); }
     received = 0;
     while (received < clen &&
@@ -641,6 +643,7 @@ int main(int argc, char **argv_orig, char **envp) {
   compressor = libdeflate_alloc_compressor(1);
   decompressor = libdeflate_alloc_decompressor();
   buf2 = afl_realloc((void **)&buf2, map_size + 16);
+  buf2_len = map_size + 16;
   if (unlikely(!buf2)) { PFATAL("alloc"); }
   lenptr = (u32 *)(buf2 + 4);
   fprintf(stderr, "Compiled with compression support\n");