From: Victor Julien Date: Tue, 5 Apr 2022 11:50:30 +0000 (+0200) Subject: detect/urilen: don't pass null pointer to pcre2 free X-Git-Tag: suricata-7.0.0-beta1~778 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7208%2Fhead;p=thirdparty%2Fsuricata.git detect/urilen: don't pass null pointer to pcre2 free Bug #5228. --- diff --git a/src/detect-urilen.c b/src/detect-urilen.c index feb61d2acb..a8a16554c8 100644 --- a/src/detect-urilen.c +++ b/src/detect-urilen.c @@ -207,7 +207,8 @@ static DetectUrilenData *DetectUrilenParse (const char *urilenstr) } } - pcre2_substring_free((PCRE2_UCHAR *)arg1); + if (arg1 != NULL) + pcre2_substring_free((PCRE2_UCHAR *)arg1); pcre2_substring_free((PCRE2_UCHAR *)arg2); if (arg3 != NULL) pcre2_substring_free((PCRE2_UCHAR *)arg3);