Skip to content

Commit

Permalink
fuzzing: fixed harness bug
Browse files Browse the repository at this point in the history
False positive bug in harness due to improper use of the internal API.

Fixes: a93d878 ("fuzzing: add fuzzing targets")
Signed-off-by: Arjun <[email protected]>
  • Loading branch information
pkillarjun committed Aug 2, 2024
1 parent d261278 commit 0112a70
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fuzzing/nxt_http_h1p_fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
goto failed;
}

r_h1p->proto.h1 = nxt_mp_zget(mp, sizeof(nxt_h1proto_t));
if (r_h1p->proto.h1 == NULL) {
goto failed;
}

r_h1p->conf = nxt_mp_zget(mp, sizeof(nxt_socket_conf_joint_t));
if (r_h1p->conf == NULL) {
goto failed;
}

r_h1p->conf->socket_conf = nxt_mp_zget(mp, sizeof(nxt_socket_conf_t));
if (r_h1p->conf->socket_conf == NULL) {
goto failed;
}

r_h1p->conf->socket_conf->max_body_size = 8 * 1024 * 1024;
r_h1p->mem_pool = mp;

nxt_http_fields_process(rp.fields, &nxt_h1p_fields_hash, r_h1p);
Expand Down

0 comments on commit 0112a70

Please sign in to comment.