From 86eec116ebe46a487b647eeb9f8bc4db2e516bd9 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 11 Jul 2024 13:28:21 +0530 Subject: [PATCH] transform/base64: add explicit mode to test Without any mode setting, the test would take up the mode to be 0 which used to be the relax mode for base64 decoder in C. However, there was no code corresponding to that mode and it was never used so nothing happened when this test was run. Add an explicit strict mode as per the expectation of the test from its comments. --- src/detect-transform-base64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/detect-transform-base64.c b/src/detect-transform-base64.c index 6988418440..f8d8f6e241 100644 --- a/src/detect-transform-base64.c +++ b/src/detect-transform-base64.c @@ -202,9 +202,7 @@ static int DetectTransformFromBase64DecodeTest02(void) { const uint8_t *input = (const uint8_t *)"This is Suricata\n"; uint32_t input_len = strlen((char *)input); - SCDetectTransformFromBase64Data b64d = { - .nbytes = input_len, - }; + SCDetectTransformFromBase64Data b64d = { .nbytes = input_len, .mode = Base64ModeStrict }; InspectionBuffer buffer; InspectionBuffer buffer_orig; InspectionBufferInit(&buffer, input_len);