diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index c836982511..bb0cfd905e 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -1,7 +1,7 @@ +/* Copyright (c) 2009 Open Information Security Foundation */ + /** - * Copyright (c) 2009 Open Information Security Foundation - * - * \file detect-detection-filter.c + * \file * \author Gerardo Iglesias * * "detection_filter" keyword support @@ -147,17 +147,17 @@ DetectThresholdData *DetectDetectionFilterParse (char *rawstr) { seconds_pos = i+1; } - if (args[count_pos] == NULL|| - ByteExtractStringUint32(&df->count, 10, strlen(args[count_pos]), - args[count_pos]) <= 0) - { + if (args[count_pos] == NULL || args[seconds_pos] == NULL) { goto error; } - if (args[seconds_pos] == NULL || - ByteExtractStringUint32(&df->seconds, 10, strlen(args[seconds_pos]), - args[seconds_pos]) <= 0) - { + if (ByteExtractStringUint32(&df->count, 10, strlen(args[count_pos]), + args[count_pos]) <= 0) { + goto error; + } + + if (ByteExtractStringUint32(&df->seconds, 10, strlen(args[seconds_pos]), + args[seconds_pos]) <= 0) { goto error; } diff --git a/src/detect-threshold.c b/src/detect-threshold.c index 01da3804ac..6ab50dc64c 100644 --- a/src/detect-threshold.c +++ b/src/detect-threshold.c @@ -158,17 +158,17 @@ static DetectThresholdData *DetectThresholdParse (char *rawstr) second_pos = i+1; } - if (args[count_pos] == NULL || - ByteExtractStringUint32(&de->count, 10, strlen(args[count_pos]), - args[count_pos]) <= 0) - { + if (args[count_pos] == NULL || args[second_pos] == NULL) { goto error; } - if (args[second_pos] == NULL || - ByteExtractStringUint32(&de->seconds, 10, strlen(args[second_pos]), - args[second_pos]) <= 0) - { + if (ByteExtractStringUint32(&de->count, 10, strlen(args[count_pos]), + args[count_pos]) <= 0) { + goto error; + } + + if (ByteExtractStringUint32(&de->seconds, 10, strlen(args[second_pos]), + args[second_pos]) <= 0) { goto error; }