@ -460,6 +460,9 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
det_ctx->pkt_ptr=NULL;
det_ctx->pkt_off=0;
/* new signature, so reset indicator of checking distance and within */
det_ctx->de_checking_distancewithin=0;
if(s->flags&SIG_FLAG_RECURSIVE){
uint8_trmatch=0;
det_ctx->pkt_cnt=0;
@ -2881,12 +2884,12 @@ static int SigTest03Wm (void) {
staticintSigTest04Real(intmpm_type){
uint8_t*buf=(uint8_t*)
"GET /one/ HTTP/1.1\r\n"
"Host: one.example.org\r\n"
"\r\n\r\n"
"GET /two/ HTTP/1.1\r\n"
"Host: two.example.org\r\n"
"\r\n\r\n";
"GET /one/ HTTP/1.1\r\n"/* 20*/
"Host: one.example.org\r\n"/* 23, post "Host:" 18 */
"\r\n\r\n"/* 4 */
"GET /two/ HTTP/1.1\r\n"/* 20 */
"Host: two.example.org\r\n"/* 23 */
"\r\n\r\n";/* 4 */
uint16_tbuflen=strlen((char*)buf);
Packetp;
@ -2910,7 +2913,7 @@ static int SigTest04Real (int mpm_type) {
de_ctx->mpm_matcher=mpm_type;
de_ctx->flags|=DE_QUIET;
de_ctx->sig_list=SigInit(de_ctx,"alert tcp any any -> any any (msg:\"HTTP TEST\"; content:\"Host:\"; offset:20; depth:25; content:\"Host:\"; distance:47; within:52; sid:1;)");
de_ctx->sig_list=SigInit(de_ctx,"alert tcp any any -> any any (msg:\"HTTP TEST\"; content:\"Host:\"; offset:20; depth:25; content:\"Host:\"; distance:42; within:47; sid:1;)");
if(de_ctx->sig_list==NULL){
result=0;
gotoend;
@ -7583,11 +7586,77 @@ static int SigTestContent04Wm (void) {
de_ctx->sig_list=SigInit(de_ctx,"alert tcp any any -> any any (msg:\"Test 32\"; content:\"01234567890123456789012345678901\"; content:\"abcdefghijklmnopqrstuvwxyzABCDEF\"; distance:0; within:31; sid:1;)");
if(de_ctx->sig_list==NULL){
gotoend;
}
de_ctx->sig_list->next=SigInit(de_ctx,"alert tcp any any -> any any (msg:\"Test 32\"; content:\"01234567890123456789012345678901\"; content:\"abcdefghijklmnopqrstuvwxyzABCDEF\"; distance:1; within:33; sid:2;)");