MCPcopy Create free account
hub / github.com/OISF/libhtp / connDiff

Function connDiff

test/fuzz/fuzz_diff.c:405–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405static int connDiff(void* rsconnp, htp_conn_t * conn) {
406 uint32_t rs = htp_connp__rstx_size(rsconnp);
407 uint32_t c = htp_list_size(conn->transactions);
408 if (rs != c) {
409 printf("Assertion failure: got nbtx c=%d versus rust=%d\n", c, rs);
410 fflush(stdout);
411#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
412 abort();
413#endif
414 return 1;
415 }
416 for (uint32_t i = 0; i < c; i++) {
417 htp_tx_t *ctx = (htp_tx_t *) htp_list_get(conn->transactions, i);
418 void *rstx = htp_connp__rstx(rsconnp, (size_t) i);
419 if (txDiff(rstx, ctx)) {
420 printf("tx %d is different\n", i);
421 return 1;
422 }
423 }
424 return 0;
425}
426
427int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
428 //initialize output file

Callers 1

LLVMFuzzerTestOneInputFunction · 0.85

Calls 1

txDiffFunction · 0.85

Tested by

no test coverage detected