From 85e8d8e20074877abfba763aceb0d763042a90be Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 15 Aug 2011 22:33:25 +0200 Subject: [PATCH] Add sanity check to DetectAdressParse. The function is only used at parsing time, this is not costly to add a simple sanity check. --- src/detect-engine-address.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index e6711e84a3..e76b32c96d 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -1223,6 +1223,11 @@ int DetectAddressParse(DetectAddressHead *gh, char *str) SCLogDebug("gh %p, str %s", gh, str); + if (str == NULL) { + SCLogDebug("DetectAddressParse can not be run with NULL address"); + goto error; + } + DetectAddressHead *ghn = DetectAddressHeadInit(); if (ghn == NULL) { SCLogDebug("DetectAddressHeadInit for ghn failed");