From 2b5eeab7d4d5d43651811cd91e436b3cc303f74a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 5 Apr 2022 13:50:30 +0200 Subject: [PATCH] detect/urilen: don't pass null pointer to pcre2 free Bug #5228. --- src/detect-urilen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.47.2