From 17a25373dbdee4422aa2b4e731b82870d096b23e Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Fri, 17 Jul 2026 10:02:59 -0300 Subject: [PATCH] fix fuzzer --- test/fuzz.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fuzz.c b/test/fuzz.c index d7991221..e9df0391 100644 --- a/test/fuzz.c +++ b/test/fuzz.c @@ -356,8 +356,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { #endif mg_tcpip_rx(&mif, pkt, size); + // prior actions may have had consequences on link state + mif.state = MG_TCPIP_STATE_READY; // Test HTTP serving (via our built-in TCP/IP stack) - const char *url = "http://localhost:12345"; + const char *url = "http://localhost:12345"; // internally resolves + // creates a connection and sends SYN via the router, unless OOM struct mg_connection *c = mg_http_connect(&mgr, url, fn, NULL); mg_iobuf_add(&c->recv, 0, data, size); c->pfn(c, MG_EV_READ, NULL); // manually invoke protocol event handler