Skip to content

Commit

Permalink
unify payload detection engines + fix other bugs in pcre init
Browse files Browse the repository at this point in the history
  • Loading branch information
Anoop Saldanha authored and victorjulien committed Feb 15, 2012
1 parent 9287cce commit 35f1f7e
Show file tree
Hide file tree
Showing 20 changed files with 661 additions and 52 deletions.
1 change: 1 addition & 0 deletions src/Makefile.am
Expand Up @@ -74,6 +74,7 @@ detect-engine-port.c detect-engine-port.h \
detect-engine-siggroup.c detect-engine-siggroup.h \
detect-engine-mpm.c detect-engine-mpm.h \
detect-engine-iponly.c detect-engine-iponly.h \
detect-engine-content-inspection.c detect-engine-content-inspection.h \
detect-engine-payload.c detect-engine-payload.h \
detect-engine-dcepayload.c detect-engine-dcepayload.h \
detect-engine-uri.c detect-engine-uri.h \
Expand Down
8 changes: 4 additions & 4 deletions src/detect-distance.c
Expand Up @@ -685,15 +685,15 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s,
/* reassigning pm */
pm = SigMatchGetLastSMFromLists(s, 4,
DETECT_AL_HTTP_METHOD, pm->prev,
DETECT_PCRE_HTTPMETHOD, pm->prev);
DETECT_PCRE, pm->prev);
if (pm == NULL) {
SCLogError(SC_ERR_DISTANCE_MISSING_CONTENT, "distance for "
"http_method needs preceeding http_method "
"content");
goto error;
}

if (pm->type == DETECT_PCRE_HTTPMETHOD) {
if (pm->type == DETECT_PCRE) {
DetectPcreData *tmp_pd = (DetectPcreData *)pm->ctx;
tmp_pd->flags |= DETECT_PCRE_RELATIVE_NEXT;
} else {
Expand Down Expand Up @@ -747,15 +747,15 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s,
/* reassigning pm */
pm = SigMatchGetLastSMFromLists(s, 4,
DETECT_AL_HTTP_COOKIE, pm->prev,
DETECT_PCRE_HTTPCOOKIE, pm->prev);
DETECT_PCRE, pm->prev);
if (pm == NULL) {
SCLogError(SC_ERR_DISTANCE_MISSING_CONTENT, "distance for "
"http_cookie needs preceeding http_cookie "
"content");
goto error;
}

if (pm->type == DETECT_PCRE_HTTPCOOKIE) {
if (pm->type == DETECT_PCRE) {
DetectPcreData *tmp_pd = (DetectPcreData *)pm->ctx;
tmp_pd->flags |= DETECT_PCRE_RELATIVE_NEXT;
} else {
Expand Down

0 comments on commit 35f1f7e

Please sign in to comment.