if (stream_start_offset != 0 && prev_buffer_offset == 0) {
if (depth <= stream_start_offset) {
- SCReturnInt(0);
+ goto no_match;
} else if (depth >= (stream_start_offset + buffer_len)) {
;
} else {
if (stream_start_offset != 0 && cd->flags & DETECT_CONTENT_DEPTH) {
if (depth <= stream_start_offset) {
- SCReturnInt(0);
+ goto no_match;
} else if (depth >= (stream_start_offset + buffer_len)) {
;
} else {
if (cd->flags & DETECT_CONTENT_NEGATED) {
goto match;
} else {
- SCReturnInt(0);
+ goto no_match;
}
}
SCLogDebug("found %p cd negated %s", found, cd->flags & DETECT_CONTENT_NEGATED ? "true" : "false");
if (found == NULL && !(cd->flags & DETECT_CONTENT_NEGATED)) {
- SCReturnInt(0);
+ goto no_match;
} else if (found == NULL && (cd->flags & DETECT_CONTENT_NEGATED)) {
goto match;
} else if (found != NULL && (cd->flags & DETECT_CONTENT_NEGATED)) {
* relative keywords */
if (DETECT_CONTENT_IS_SINGLE(cd))
det_ctx->discontinue_matching = 1;
- SCReturnInt(0);
+ goto no_match;
} else {
match_offset = (uint32_t)((found - buffer) + cd->content_len);
SCLogDebug("content %"PRIu32" matched at offset %"PRIu32"", cd->id, match_offset);
* error, as the current cd has the DETECT_CONTENT_RELATIVE_NEXT
* flag set. */
if (sm->next == NULL) {
- SCReturnInt(0);
+ goto no_match;
}
SCLogDebug("content %"PRIu32, cd->id);
}
if (det_ctx->discontinue_matching)
- SCReturnInt(0);
+ goto no_match;
/* set the previous match offset to the start of this match + 1 */
prev_offset = (match_offset - (cd->content_len - 1));
SCLogDebug("det_ctx->buffer_offset + id->dataat %"PRIu32" > %"PRIu32, det_ctx->buffer_offset + id->dataat, buffer_len);
if (id->flags & ISDATAAT_NEGATED)
goto match;
- SCReturnInt(0);
+ goto no_match;
} else {
SCLogDebug("relative isdataat match");
if (id->flags & ISDATAAT_NEGATED)
- SCReturnInt(0);
+ goto no_match;
goto match;
}
} else {
if (id->dataat < buffer_len) {
SCLogDebug("absolute isdataat match");
if (id->flags & ISDATAAT_NEGATED)
- SCReturnInt(0);
+ goto no_match;
goto match;
} else {
SCLogDebug("absolute isdataat mismatch, id->isdataat %"PRIu32", buffer_len %"PRIu32"", id->dataat, buffer_len);
if (id->flags & ISDATAAT_NEGATED)
goto match;
- SCReturnInt(0);
+ goto no_match;
}
}
r = DetectPcrePayloadMatch(det_ctx, s, sm, p, f,
buffer, buffer_len);
if (r == 0) {
- SCReturnInt(0);
+ goto no_match;
}
if (!(pe->flags & DETECT_PCRE_RELATIVE_NEXT)) {
}
if (det_ctx->discontinue_matching)
- SCReturnInt(0);
+ goto no_match;
det_ctx->buffer_offset = prev_buffer_offset;
det_ctx->pcre_match_start_offset = prev_offset;
if (DetectBytetestDoMatch(det_ctx, s, sm, buffer, buffer_len, flags,
offset, value) != 1) {
- SCReturnInt(0);
+ goto no_match;
}
goto match;
if (DetectBytejumpDoMatch(det_ctx, s, sm, buffer, buffer_len,
flags, offset) != 1) {
- SCReturnInt(0);
+ goto no_match;
}
goto match;
buffer_len,
&det_ctx->bj_values[bed->local_id],
endian) != 1) {
- SCReturnInt(0);
+ goto no_match;
}
goto match;
det_ctx->discontinue_matching = 0;
- SCReturnInt(0);
+ goto no_match;
#ifdef HAVE_LUAJIT
}
else if (sm->type == DETECT_LUAJIT) {
if (DetectLuajitMatchBuffer(det_ctx, s, sm, buffer, buffer_len,
det_ctx->buffer_offset, f, need_flow_lock) != 1)
{
- SCReturnInt(0);
+ goto no_match;
}
goto match;
#endif
#endif
}
+no_match:
SCReturnInt(0);
match: