static int SigTest70TestNegatedContent(void)
{
- return SigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; content:!\"fourty\"; within:52; distance:45 sid:1;)", (uint8_t *)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
+ return SigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; content:!\"fourty\"; within:52; sid:1;)", (uint8_t *)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
}
/** \test within and distance */
#include "flow-var.h"
+#include "util-byte.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "detect-bytejump.h"
cd->distance = ((DetectByteExtractData *)bed_sm->ctx)->local_id;
cd->flags |= DETECT_CONTENT_DISTANCE_BE;
} else {
- cd->distance = strtol(str, NULL, 10);
+ if (ByteExtractStringInt32(&cd->distance, 0, 0, str) != (int)strlen(str)) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE,
+ "invalid value for distance: %s", str);
+ goto end;
+ }
}
cd->flags |= DETECT_CONTENT_DISTANCE;