Skip to content

Commit 4398b9b

Browse files
committed
fix network server
1 parent 909262f commit 4398b9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/afl_network_proxy/afl-network-server.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static u8 *in_data; /* Input data for trimming */
7474
static u8 *buf2;
7575

7676
static s32 in_len;
77+
static s32 buf2_len;
7778
static u32 map_size = MAP_SIZE;
7879

7980
static volatile u8 stop_soon; /* Ctrl-C pressed? */
@@ -381,6 +382,7 @@ int recv_testcase(int s, void **buf) {
381382
if (clen < 1)
382383
FATAL("did not receive valid compressed len information: %u", clen);
383384
buf2 = afl_realloc((void **)&buf2, clen);
385+
buf2_len = clen;
384386
if (unlikely(!buf2)) { PFATAL("Alloc"); }
385387
received = 0;
386388
while (received < clen &&
@@ -641,6 +643,7 @@ int main(int argc, char **argv_orig, char **envp) {
641643
compressor = libdeflate_alloc_compressor(1);
642644
decompressor = libdeflate_alloc_decompressor();
643645
buf2 = afl_realloc((void **)&buf2, map_size + 16);
646+
buf2_len = map_size + 16;
644647
if (unlikely(!buf2)) { PFATAL("alloc"); }
645648
lenptr = (u32 *)(buf2 + 4);
646649
fprintf(stderr, "Compiled with compression support\n");

0 commit comments

Comments
 (0)