fixed alloc errors, code format

This commit is contained in:
Dominik Maier
2020-11-18 02:33:47 +01:00
parent 54fdec0e51
commit 23f37ff505
6 changed files with 25 additions and 15 deletions

View File

@ -358,8 +358,8 @@ int recv_testcase(int s, void **buf) {
if ((size & 0xff000000) != 0xff000000) {
*buf = afl_realloc((void **)&buf, size);
if (unlikely(!buf)) { PFATAL("Alloc"); }
*buf = afl_realloc(buf, size);
if (unlikely(!*buf)) { PFATAL("Alloc"); }
received = 0;
// fprintf(stderr, "unCOMPRESS (%u)\n", size);
while (received < size &&
@ -371,8 +371,8 @@ int recv_testcase(int s, void **buf) {
#ifdef USE_DEFLATE
u32 clen;
size -= 0xff000000;
*buf = afl_realloc((void **)&buf, size);
if (unlikely(!buf)) { PFATAL("Alloc"); }
*buf = afl_realloc(buf, size);
if (unlikely(!*buf)) { PFATAL("Alloc"); }
received = 0;
while (received < 4 &&
(ret = recv(s, &clen + received, 4 - received, 0)) > 0)