From: Philippe Antoine Date: Thu, 18 Feb 2021 14:43:16 +0000 (+0100) Subject: detect: adds test with invalid uint mode << X-Git-Tag: suricata-7.0.0-beta1~1019 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d4fe38ccbd1c1536d2949c628795b8864ee2a00;p=thirdparty%2Fsuricata.git detect: adds test with invalid uint mode << --- diff --git a/src/detect-icode.c b/src/detect-icode.c index 59d4449dab..7058853c31 100644 --- a/src/detect-icode.c +++ b/src/detect-icode.c @@ -337,6 +337,19 @@ static int DetectICodeParseTest08(void) PASS; } +/** + * \test DetectICodeParseTest09 is a test for setting an invalid icode value + * with "<<" operator + */ +static int DetectICodeParseTest09(void) +{ + DetectU8Data *icd = DetectU8Parse("8<<20"); + FAIL_IF_NOT_NULL(icd); + + DetectICodeFree(NULL, icd); + PASS; +} + /** * \test DetectICodeMatchTest01 is a test for checking the working of icode * keyword by creating 5 rules and matching a crafted packet against @@ -407,6 +420,7 @@ void DetectICodeRegisterTests(void) UtRegisterTest("DetectICodeParseTest06", DetectICodeParseTest06); UtRegisterTest("DetectICodeParseTest07", DetectICodeParseTest07); UtRegisterTest("DetectICodeParseTest08", DetectICodeParseTest08); + UtRegisterTest("DetectICodeParseTest09", DetectICodeParseTest09); UtRegisterTest("DetectICodeMatchTest01", DetectICodeMatchTest01); } #endif /* UNITTESTS */