From: Shivani Bhardwaj Date: Thu, 11 Jul 2024 07:58:21 +0000 (+0530) Subject: transform/base64: add explicit mode to test X-Git-Tag: suricata-8.0.0-beta1~853 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86eec116ebe46a487b647eeb9f8bc4db2e516bd9;p=thirdparty%2Fsuricata.git 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. --- 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);