From a0a3f20f0cf4115117268cdcd9b6f3b1082b7d3b Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 18 Jul 2025 11:00:52 +0200 Subject: [PATCH] htp/test: fix test to pass with UBSAN Ticket: 6934 Avoids a call to memcpy with NULL ptr and 0 length --- src/app-layer-htp.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.47.2