From 719207693ef42953e50b1422c59fafc497320d41 Mon Sep 17 00:00:00 2001 From: Arjun Date: Wed, 7 Aug 2024 15:08:46 +0530 Subject: 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 Signed-off-by: Andrew Clayton --- fuzzing/nxt_http_h1p_peer_fuzz.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fuzzing/nxt_http_h1p_peer_fuzz.c') diff --git a/fuzzing/nxt_http_h1p_peer_fuzz.c b/fuzzing/nxt_http_h1p_peer_fuzz.c index 54876658..43786d0c 100644 --- a/fuzzing/nxt_http_h1p_peer_fuzz.c +++ b/fuzzing/nxt_http_h1p_peer_fuzz.c @@ -62,6 +62,16 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) goto failed; } + req->peer = nxt_mp_zalloc(mp, sizeof(nxt_http_peer_t)); + if (req->peer == NULL) { + goto failed; + } + + req->peer->proto.h1 = nxt_mp_zalloc(mp, sizeof(nxt_h1proto_t)); + if (req->peer->proto.h1 == NULL) { + goto failed; + } + buf.start = (u_char *)data; buf.end = (u_char *)data + size; buf.pos = buf.start; -- cgit