diff --git a/src/detect-distance.c b/src/detect-distance.c index bec04a7062..f8bebad158 100644 --- a/src/detect-distance.c +++ b/src/detect-distance.c @@ -196,6 +196,7 @@ static int DetectDistanceTest01(void) DetectContentData *co = (DetectContentData *)sm->ctx; if (co == NULL) { printf("co == NULL: "); + goto end; } if (co->distance != 4) { diff --git a/src/detect-http-header.c b/src/detect-http-header.c index 4e11bad64c..8488503c50 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -267,10 +267,12 @@ static int DetectHttpHeaderTest01(void) de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any " "(msg:\"Testing http_header\"; " "content:one; http_header; sid:1;)"); - if (de_ctx->sig_list != NULL) + if (de_ctx->sig_list != NULL) { result = 1; - else + } else { printf("Error parsing signature: "); + goto end; + } sm = de_ctx->sig_list->match; if (sm != NULL) { diff --git a/src/detect-uricontent.c b/src/detect-uricontent.c index baf767b085..e878056338 100644 --- a/src/detect-uricontent.c +++ b/src/detect-uricontent.c @@ -1016,7 +1016,7 @@ static int DetectUriSigTest04(void) { s->match != NULL) { printf("sig 3 failed to parse: "); - DetectContentPrint((DetectContentData *) s->pmatch_tail->ctx); + //DetectContentPrint((DetectContentData *) s->pmatch_tail->ctx); goto end; } diff --git a/src/detect.c b/src/detect.c index 1f21b04229..0495ab1e76 100644 --- a/src/detect.c +++ b/src/detect.c @@ -2648,7 +2648,7 @@ int SigAddressPrepareStage5(DetectEngineCtx *de_ctx) { if (global_src_gr->sh != NULL) { printf(" - "); for (u = 0; u < global_src_gr->sh->sig_cnt; u++) { - Signature *s = de_ctx->sig_array[global_dst_gr->sh->match_array[u]]; + Signature *s = de_ctx->sig_array[global_src_gr->sh->match_array[u]]; printf("%" PRIu32 " ", s->id); } printf("\n");