From: Philippe Antoine Date: Fri, 18 Jul 2025 09:00:52 +0000 (+0200) Subject: htp/test: fix test to pass with UBSAN X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0a3f20f0cf4115117268cdcd9b6f3b1082b7d3b;p=thirdparty%2Fsuricata.git htp/test: fix test to pass with UBSAN Ticket: 6934 Avoids a call to memcpy with NULL ptr and 0 length --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 51754e8015..86b45f98ca 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -6127,6 +6127,8 @@ static int HTPBodyReassemblyTest01(void) BUG_ON(r != 0); r = HtpBodyAppendChunk(NULL, &htud.request_body, chunk2, sizeof(chunk2)-1); BUG_ON(r != 0); + htud.boundary = (uint8_t *)strdup("e5a320f21416a02493a0a6f561b1c494"); + htud.boundary_len = strlen("e5a320f21416a02493a0a6f561b1c494"); const uint8_t *chunks_buffer = NULL; uint32_t chunks_buffer_len = 0; @@ -6152,6 +6154,7 @@ static int HTPBodyReassemblyTest01(void) result = 1; end: + SCFree(htud.boundary); return result; }