Fix typo in depth changes.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent dab679889c
commit 747daf4bce

@ -70,12 +70,10 @@ static int DetectDepthSetup (DetectEngineCtx *de_ctx, Signature *s, char *depths
return -1; return -1;
} }
DetectUricontentData *ud = NULL;
DetectContentData *cd = NULL;
switch (pm->type) { switch (pm->type) {
case DETECT_URICONTENT: case DETECT_URICONTENT:
ud = (DetectUricontentData *)pm->ctx; {
DetectUricontentData *ud = (DetectUricontentData *)pm->ctx;
if (ud == NULL) { if (ud == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, "invalid argument"); SCLogError(SC_ERR_INVALID_ARGUMENT, "invalid argument");
if (dubbed) SCFree(str); if (dubbed) SCFree(str);
@ -85,15 +83,17 @@ static int DetectDepthSetup (DetectEngineCtx *de_ctx, Signature *s, char *depths
if (ud->uricontent_len + ud->offset > ud->depth) { if (ud->uricontent_len + ud->offset > ud->depth) {
uint32_t depth = (ud->depth > ud->uricontent_len) ? uint32_t depth = (ud->depth > ud->uricontent_len) ?
ud->depth : ud->uricontent_len; ud->depth : ud->uricontent_len;
cd->depth = cd->offset + depth; ud->depth = ud->offset + depth;
SCLogDebug("depth increased to %"PRIu32" to match pattern len " SCLogDebug("depth increased to %"PRIu32" to match pattern len "
"and offset", ud->depth); "and offset", ud->depth);
} }
}
break; break;
case DETECT_CONTENT: case DETECT_CONTENT:
cd = (DetectContentData *)pm->ctx; {
DetectContentData *cd = (DetectContentData *)pm->ctx;
if (cd == NULL) { if (cd == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, "invalid argument"); SCLogError(SC_ERR_INVALID_ARGUMENT, "invalid argument");
if (dubbed) SCFree(str); if (dubbed) SCFree(str);
@ -108,6 +108,7 @@ static int DetectDepthSetup (DetectEngineCtx *de_ctx, Signature *s, char *depths
SCLogDebug("depth increased to %"PRIu32" to match pattern len " SCLogDebug("depth increased to %"PRIu32" to match pattern len "
"and offset", cd->depth); "and offset", cd->depth);
} }
}
break; break;
default: default:

Loading…
Cancel
Save