From 5d85b0f7b7ec517232ca060c045ec652a4c6573a Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Tue, 31 May 2011 18:35:16 -0500 Subject: [PATCH] Fix potential crash in ip-only address parsing code --- src/detect-engine-iponly.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index 8fad7159e2..209839143e 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -523,8 +523,11 @@ int IPOnlyCIDRListParse(IPOnlyCIDRItem **gh, char *str) { SCLogDebug("gh %p, str %s", gh, str); + if (gh == NULL) + goto error; + *gh = IPOnlyCIDRListParse2(str, 0); - if (gh == NULL) { + if (*gh == NULL) { SCLogDebug("DetectAddressParse2 returned null"); goto error; }