fixed the incorrect depth update incase of offset is 0 (bug 134)

remotes/origin/master-1.0.x
Gurvinder Singh 16 years ago committed by Victor Julien
parent fc2029ef58
commit 719fa5f5e1

@ -131,7 +131,7 @@ static int DoInspectPacketPayload(DetectEngineCtx *de_ctx,
/* update offset with prev_offset if we're searching for
* matches after the first occurence. */
SCLogDebug("offset %"PRIu32", prev_offset %"PRIu32, prev_offset, depth);
SCLogDebug("offset %"PRIu32", prev_offset %"PRIu32, offset, prev_offset);
offset += prev_offset;
SCLogDebug("offset %"PRIu32", depth %"PRIu32, offset, depth);

@ -73,7 +73,7 @@ int DetectOffsetSetup (DetectEngineCtx *de_ctx, Signature *s, char *offsetstr)
return -1;
}
cd->offset = (uint32_t)atoi(str);
if (cd->depth != 0) {
if (cd->depth != 0 && cd->offset != 0) {
SCLogDebug("depth increased to %"PRIu32" to match pattern len"
" and offset", cd->content_len + cd->offset);
cd->depth = cd->content_len + cd->offset;

Loading…
Cancel
Save