From a2480bc07bb276a325cd8d1f18b79c814b83ff9d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 27 May 2011 10:20:32 +0200 Subject: [PATCH] Fix potential parsing issue in detection filter code. --- src/detect-detection-filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index 5378297fb3..272f4cb9cd 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -116,6 +116,8 @@ DetectThresholdData *DetectDetectionFilterParse (char *rawstr) { int i = 0; copy_str = SCStrdup(rawstr); + if (copy_str == NULL) + goto error; for(pos = 0, df_opt = strtok(copy_str,","); pos < strlen(copy_str) && df_opt != NULL; pos++, df_opt = strtok(NULL,",")) { @@ -126,9 +128,7 @@ DetectThresholdData *DetectDetectionFilterParse (char *rawstr) { if(strstr(df_opt,"track")) track_found++; } - - if(copy_str) - SCFree(copy_str); + SCFree(copy_str); if(count_found != 1 || seconds_found != 1 || track_found != 1) goto error;