Skip to content

Commit

Permalink
Merge pull request #321 from ngtcp2/fix-fuzzer
Browse files Browse the repository at this point in the history
fuzz: Submit response if nghttp3_conn is server
  • Loading branch information
tatsuhiro-t authored Jan 29, 2025
2 parents 39f6998 + 288aba6 commit 730e8d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fuzz/fuzz_http3serverreq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern "C" {

#include "nghttp3_macro.h"
#include "nghttp3_stream.h"
#include "nghttp3_conn.h"

#ifdef __cplusplus
}
Expand Down Expand Up @@ -141,8 +142,12 @@ int end_stream(nghttp3_conn *conn, int64_t stream_id, void *conn_user_data,
},
};

return nghttp3_conn_submit_response(conn, stream_id, nva,
nghttp3_arraylen(nva), nullptr);
if (conn->server) {
return nghttp3_conn_submit_response(conn, stream_id, nva,
nghttp3_arraylen(nva), nullptr);
}

return 0;
}
}; // namespace

Expand Down

0 comments on commit 730e8d9

Please sign in to comment.