]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/urilen: don't pass null pointer to pcre2 free 7208/head
authorVictor Julien <vjulien@oisf.net>
Tue, 5 Apr 2022 11:50:30 +0000 (13:50 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 5 Apr 2022 11:50:35 +0000 (13:50 +0200)
Bug #5228.

src/detect-urilen.c

index feb61d2acb49c1785c33fbcbb9643c3292cf40f1..a8a16554c834f43c2b17fe0420190f8e718892f1 100644 (file)
@@ -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);