Skip to content

Commit 7192076

Browse files
pkillarjunac000
authored andcommitted
fuzzing: fixed harness bug
False positive bug in harness due to improper use of the internal API. Fixes: a93d878 ("fuzzing: add fuzzing targets") Signed-off-by: Arjun <pkillarjun@protonmail.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent cff18f8 commit 7192076

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fuzzing/nxt_http_h1p_peer_fuzz.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
6262
goto failed;
6363
}
6464

65+
req->peer = nxt_mp_zalloc(mp, sizeof(nxt_http_peer_t));
66+
if (req->peer == NULL) {
67+
goto failed;
68+
}
69+
70+
req->peer->proto.h1 = nxt_mp_zalloc(mp, sizeof(nxt_h1proto_t));
71+
if (req->peer->proto.h1 == NULL) {
72+
goto failed;
73+
}
74+
6575
buf.start = (u_char *)data;
6676
buf.end = (u_char *)data + size;
6777
buf.pos = buf.start;

0 commit comments

Comments
 (0)