|
|
|
@ -28,6 +28,7 @@
|
|
|
|
#include "app-layer-htp.h"
|
|
|
|
#include "app-layer-htp.h"
|
|
|
|
#include "util-unittest.h"
|
|
|
|
#include "util-unittest.h"
|
|
|
|
#include "util-unittest-helper.h"
|
|
|
|
#include "util-unittest-helper.h"
|
|
|
|
|
|
|
|
#include "util-misc.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "detect.h"
|
|
|
|
#include "detect.h"
|
|
|
|
#include "detect-parse.h"
|
|
|
|
#include "detect-parse.h"
|
|
|
|
@ -43,7 +44,7 @@
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* \brief Regex for parsing our filesize
|
|
|
|
* \brief Regex for parsing our filesize
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define PARSE_REGEX "^(?:\\s*)(<|>)?(?:\\s*)([0-9]{1,23})(?:\\s*)(?:(<>)(?:\\s*)([0-9]{1,23}))?\\s*$"
|
|
|
|
#define PARSE_REGEX "^(?:\\s*)(<|>)?(?:\\s*)([0-9]{1,23}[a-zA-Z]{0,2})(?:\\s*)(?:(<>)(?:\\s*)([0-9]{1,23}[a-zA-Z]{0,2}))?\\s*$"
|
|
|
|
|
|
|
|
|
|
|
|
static pcre *parse_regex;
|
|
|
|
static pcre *parse_regex;
|
|
|
|
static pcre_extra *parse_regex_study;
|
|
|
|
static pcre_extra *parse_regex_study;
|
|
|
|
@ -214,8 +215,8 @@ static DetectFilesizeData *DetectFilesizeParse (const char *str)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** set the first value */
|
|
|
|
/** set the first value */
|
|
|
|
if (ByteExtractStringUint64(&fsd->size1,10,strlen(arg2),arg2) <= 0){
|
|
|
|
if (ParseSizeStringU64(arg2, &fsd->size1) < 0) {
|
|
|
|
SCLogError(SC_ERR_INVALID_ARGUMENT,"Invalid size :\"%s\"",arg2);
|
|
|
|
SCLogError(SC_ERR_SIZE_PARSE, "Error parsing filesize value - %s", arg2);
|
|
|
|
goto error;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -227,9 +228,8 @@ static DetectFilesizeData *DetectFilesizeParse (const char *str)
|
|
|
|
goto error;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(ByteExtractStringUint64(&fsd->size2,10,strlen(arg4),arg4) <= 0)
|
|
|
|
if (ParseSizeStringU64(arg4, &fsd->size2) < 0) {
|
|
|
|
{
|
|
|
|
SCLogError(SC_ERR_SIZE_PARSE, "Error parsing filesize value - %s", arg4);
|
|
|
|
SCLogError(SC_ERR_INVALID_ARGUMENT,"Invalid size :\"%s\"",arg4);
|
|
|
|
|
|
|
|
goto error;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|