Fix potential parsing issue in threshold code.

remotes/origin/master-1.0.x
Victor Julien 15 years ago
parent 5465672208
commit a11b3a1aa2

@ -121,6 +121,8 @@ static DetectThresholdData *DetectThresholdParse (char *rawstr)
int i = 0;
copy_str = SCStrdup(rawstr);
if (copy_str == NULL)
goto error;
for(pos = 0, threshold_opt = strtok(copy_str,","); pos < strlen(copy_str) && threshold_opt != NULL; pos++, threshold_opt = strtok(NULL,",")) {
@ -134,8 +136,7 @@ static DetectThresholdData *DetectThresholdParse (char *rawstr)
track_found++;
}
if(copy_str)
SCFree(copy_str);
SCFree(copy_str);
if(count_found != 1 || second_found != 1 || type_found != 1 || track_found != 1)
goto error;

Loading…
Cancel
Save