unittests for dce_stub_data content based singature parsing + fixes

remotes/origin/master-1.0.x
Anoop Saldanha 16 years ago committed by Victor Julien
parent ce8d27425d
commit 673322f01f

@ -603,6 +603,12 @@ int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, char *optstr)
break;
case DETECT_BYTEJUMP:
SCLogDebug("No setting relative_next for bytejump. We "
"have no use for it");
break;
default:
/* this will never hit */
SCLogError(SC_ERR_INVALID_SIGNATURE, "Unknown previous-"

@ -619,6 +619,12 @@ int DetectBytetestSetup(DetectEngineCtx *de_ctx, Signature *s, char *optstr)
break;
case DETECT_BYTEJUMP:
SCLogDebug("No setting relative_next for bytejump. We "
"have no use for it");
break;
default:
/* this will never hit */
SCLogError(SC_ERR_INVALID_SIGNATURE, "Unknown previous-"

@ -97,7 +97,7 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s,
DETECT_PCRE, s->pmatch_tail,
DETECT_BYTEJUMP, s->pmatch_tail);
if (pm1_ots != NULL && pm1_ots->prev != NULL) {
pm2_ots = SigMatchGetLastSMFromLists(s, 2,
pm2_ots = SigMatchGetLastSMFromLists(s, 6,
DETECT_CONTENT, pm1_ots->prev,
DETECT_PCRE, pm1_ots->prev,
DETECT_BYTEJUMP, pm1_ots->prev);
@ -265,6 +265,12 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s,
break;
case DETECT_BYTEJUMP:
SCLogDebug("No setting relative_next for bytejump. We "
"have no use for it");
break;
default:
/* this will never hit */
SCLogError(SC_ERR_INVALID_SIGNATURE, "Unknown previous-"

File diff suppressed because it is too large Load Diff

@ -301,6 +301,12 @@ int DetectIsdataatSetup (DetectEngineCtx *de_ctx, Signature *s, char *isdataatst
break;
case DETECT_BYTEJUMP:
SCLogDebug("No setting relative_next for bytejump. We "
"have no use for it");
break;
default:
/* this will never hit */
SCLogError(SC_ERR_INVALID_SIGNATURE, "Unknown previous-"

@ -520,16 +520,15 @@ void SigMatchTransferSigMatchAcrossLists(SigMatch *sm,
{
/* we won't do any checks for args */
if (sm == *src_sm_list) {
*src_sm_list = sm->next;
} else {
if (sm->prev != NULL)
sm->prev->next = sm->next;
if (sm->next != NULL)
sm->next->prev = sm->prev;
}
if (sm == *src_sm_list_tail) {
if (sm == *src_sm_list)
*src_sm_list = sm->next;
if (sm == *src_sm_list_tail)
*src_sm_list_tail = sm->prev;
}
if (*dst_sm_list == NULL) {
*dst_sm_list = sm;

@ -27,13 +27,13 @@
#define DETECT_PCRE_RELATIVE 0x01
#define DETECT_PCRE_RAWBYTES 0x02
#define DETECT_PCRE_URI 0x04
#define DETECT_PCRE_RELATIVE_NEXT 0x08
#define DETECT_PCRE_CAPTURE_PKT 0x08
#define DETECT_PCRE_CAPTURE_FLOW 0x10
#define DETECT_PCRE_MATCH_LIMIT 0x20
#define DETECT_PCRE_HTTP_BODY_AL 0x40
#define DETECT_PCRE_RELATIVE_NEXT 0x80
typedef struct DetectPcreData_ {
/* pcre options */

@ -100,7 +100,7 @@ static int DetectWithinSetup (DetectEngineCtx *de_ctx, Signature *s, char *withi
DETECT_PCRE, s->pmatch_tail,
DETECT_BYTEJUMP, s->pmatch_tail);
if (pm1_ots != NULL && pm1_ots->prev != NULL) {
pm2_ots = SigMatchGetLastSMFromLists(s, 2,
pm2_ots = SigMatchGetLastSMFromLists(s, 6,
DETECT_CONTENT, pm1_ots->prev,
DETECT_PCRE, pm1_ots->prev,
DETECT_BYTEJUMP, pm1_ots->prev);
@ -248,7 +248,7 @@ static int DetectWithinSetup (DetectEngineCtx *de_ctx, Signature *s, char *withi
pm = SigMatchGetLastSMFromLists(s, 6,
DETECT_CONTENT, pm->prev,
DETECT_PCRE, pm->prev,
DETECT_BYTEJUMP, s->pmatch_tail);
DETECT_BYTEJUMP, pm->prev);
DetectPcreData *pe = NULL;
if (pm == NULL) {
@ -286,6 +286,12 @@ static int DetectWithinSetup (DetectEngineCtx *de_ctx, Signature *s, char *withi
break;
case DETECT_BYTEJUMP:
SCLogDebug("No setting relative_next for bytejump. We "
"have no use for it");
break;
default:
/* this will never hit */
SCLogError(SC_ERR_INVALID_SIGNATURE, "Unknown previous-"

Loading…
Cancel
Save