reject rules that have multiple depths, offsets, distances, fast_patterns, nocases, or rawbytes for the same content.
goto error;
}
+ if (cd->flags & DETECT_CONTENT_DEPTH) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple depths for the same content.");
+ goto error;
+ }
+
if (str[0] != '-' && isalpha(str[0])) {
SigMatch *bed_sm =
DetectByteExtractRetrieveSMVar(str, s,
goto error;
}
+ if (cd->flags & DETECT_CONTENT_DISTANCE) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple distances with the same content. ");
+ goto error;
+ }
+
if (str[0] != '-' && isalpha(str[0])) {
SigMatch *bed_sm =
DetectByteExtractRetrieveSMVar(str, s,
}
if (arg == NULL|| strcmp(arg, "") == 0) {
+ if (cd->flags & DETECT_CONTENT_FAST_PATTERN) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple fast_pattern options for the same content. ");
+ goto error;
+ }
cd->flags |= DETECT_CONTENT_FAST_PATTERN;
return 0;
}
SCLogError(SC_ERR_INVALID_ARGUMENT, "invalid argument");
SCReturnInt(-1);
}
+ if (cd->flags & DETECT_CONTENT_NOCASE) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple nocase modifiers with the same content; ignoring this option. ");
+ SCReturnInt(-1);
+ }
cd->flags |= DETECT_CONTENT_NOCASE;
/* Recreate the context with nocase chars */
BoyerMooreCtxToNocase(cd->bm_ctx, cd->content, cd->content_len);
goto error;
}
+ if (cd->flags & DETECT_CONTENT_OFFSET) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple offsets for the same content. ");
+ goto error;
+ }
+
if (str[0] != '-' && isalpha(str[0])) {
SigMatch *bed_sm =
DetectByteExtractRetrieveSMVar(str, s,
case DETECT_CONTENT:
{
DetectContentData *cd = (DetectContentData *)pm->ctx;
+ if (cd->flags & DETECT_CONTENT_RAWBYTES) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "You can't use multiple rawbytes modifiers for the same content. ");
+ SCReturnInt(-1);
+ }
cd->flags |= DETECT_CONTENT_RAWBYTES;
break;
}