From: Victor Julien Date: Fri, 9 Mar 2012 17:36:07 +0000 (+0100) Subject: Misc fixes. X-Git-Tag: suricata-1.3beta1~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d72b82fae07c44b55aa9d289a6245f24aff183ae;p=thirdparty%2Fsuricata.git Misc fixes. --- diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index 8dd0bfa13a..9ccbf3f87e 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -3734,8 +3734,6 @@ int DetectByteExtractTest55(void) DetectContentData *cd = NULL; DetectByteExtractData *bed1 = NULL; DetectByteExtractData *bed2 = NULL; - DetectByteExtractData *bed3 = NULL; - DetectByteExtractData *bed4 = NULL; de_ctx = DetectEngineCtxInit(); if (de_ctx == NULL) @@ -3752,18 +3750,15 @@ int DetectByteExtractTest55(void) "content: \"four\"; within:two; distance:three; " "sid:1;)"); if (de_ctx->sig_list == NULL) { - result = 0; goto end; } if (s->sm_lists_tail[DETECT_SM_LIST_PMATCH] == NULL) { - result = 0; goto end; } sm = s->sm_lists[DETECT_SM_LIST_PMATCH]; if (sm->type != DETECT_CONTENT) { - result = 0; goto end; } cd = (DetectContentData *)sm->ctx; @@ -3775,14 +3770,12 @@ int DetectByteExtractTest55(void) cd->flags & DETECT_CONTENT_FAST_PATTERN || !(cd->flags & DETECT_CONTENT_RELATIVE_NEXT) || cd->flags & DETECT_CONTENT_NEGATED ) { - printf("one failed\n"); - result = 0; + printf("one failed: "); goto end; } sm = sm->next; if (sm->type != DETECT_BYTE_EXTRACT) { - result = 0; goto end; } bed1 = (DetectByteExtractData *)sm->ctx; @@ -3797,34 +3790,27 @@ int DetectByteExtractTest55(void) goto end; } if (bed1->local_id != 0) { - result = 0; goto end; } sm = sm->next; if (sm->type != DETECT_BYTE_EXTRACT) { - result = 0; goto end; } bed2 = (DetectByteExtractData *)sm->ctx; sm = sm->next; if (sm->type != DETECT_BYTE_EXTRACT) { - result = 0; goto end; } - bed3 = (DetectByteExtractData *)sm->ctx; sm = sm->next; if (sm->type != DETECT_BYTE_EXTRACT) { - result = 0; goto end; } - bed4 = (DetectByteExtractData *)sm->ctx; sm = sm->next; if (sm->type != DETECT_CONTENT) { - result = 0; goto end; } cd = (DetectContentData *)sm->ctx; @@ -3835,8 +3821,7 @@ int DetectByteExtractTest55(void) DETECT_CONTENT_WITHIN) || cd->within != bed1->local_id || cd->distance != bed2->local_id) { - printf("four failed\n"); - result = 0; + printf("four failed: "); goto end; } @@ -3863,8 +3848,6 @@ int DetectByteExtractTest56(void) DetectContentData *cd = NULL; DetectByteExtractData *bed1 = NULL; DetectByteExtractData *bed2 = NULL; - DetectByteExtractData *bed3 = NULL; - DetectByteExtractData *bed4 = NULL; de_ctx = DetectEngineCtxInit(); if (de_ctx == NULL) @@ -3965,14 +3948,12 @@ int DetectByteExtractTest56(void) result = 0; goto end; } - bed3 = (DetectByteExtractData *)sm->ctx; sm = sm->next; if (sm->type != DETECT_BYTE_EXTRACT) { result = 0; goto end; } - bed4 = (DetectByteExtractData *)sm->ctx; sm = sm->next; if (sm->type != DETECT_CONTENT) { diff --git a/src/tm-threads.c b/src/tm-threads.c index ffc35dd4fb..2623d7a936 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1454,7 +1454,7 @@ void TmThreadDisableReceiveThreads(void) TmSlot *slots = tv->tm_slots; TmModule *tm = TmModuleGetById(slots->tm_id); - if (!tm->flags & TM_FLAG_RECEIVE_TM) { + if (!(tm->flags & TM_FLAG_RECEIVE_TM)) { tv = tv->next; continue; }