From fe700737a3edf88d936f1a3d4beb008e2775a359 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Wed, 1 Sep 2010 23:19:44 +0530 Subject: [PATCH] fix null dereference in detect parse test - clang fix --- src/detect-parse.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/detect-parse.c b/src/detect-parse.c index 3350ca6c92..168d103557 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -2058,29 +2058,31 @@ int SigParseTest09(void) { DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\"; sid:1; rev:4;)"); DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\"; sid:2; rev:2;)"); result &= (de_ctx->sig_list != NULL && de_ctx->sig_list->id == 2 && - de_ctx->sig_list->rev == 2); + de_ctx->sig_list->rev == 2); + if (result == 0) + goto end; result &= (de_ctx->sig_list->next != NULL && de_ctx->sig_list->next->id == 1 && - de_ctx->sig_list->next->rev == 6); + de_ctx->sig_list->next->rev == 6); if (result == 0) goto end; DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\"; sid:2; rev:1;)"); result &= (de_ctx->sig_list != NULL && de_ctx->sig_list->id == 2 && - de_ctx->sig_list->rev == 2); + de_ctx->sig_list->rev == 2); if (result == 0) goto end; result &= (de_ctx->sig_list->next != NULL && de_ctx->sig_list->next->id == 1 && - de_ctx->sig_list->next->rev == 6); + de_ctx->sig_list->next->rev == 6); if (result == 0) goto end; DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\"; sid:2; rev:4;)"); result &= (de_ctx->sig_list != NULL && de_ctx->sig_list->id == 2 && - de_ctx->sig_list->rev == 4); + de_ctx->sig_list->rev == 4); if (result == 0) goto end; result &= (de_ctx->sig_list->next != NULL && de_ctx->sig_list->next->id == 1 && - de_ctx->sig_list->next->rev == 6); + de_ctx->sig_list->next->rev == 6); if (result == 0) goto end;