diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 33412c0cfa..0a349199da 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -1271,9 +1271,7 @@ int HTPParserTest05(void) { goto end; } - if (tx->response_status_number != 200 || - h == NULL || tx->request_protocol_number != HTTP_1_0) - { + if (tx->response_status_number != 200) { printf("expected response 200 OK and got %"PRId32" %s: , expected protocol " "HTTP/1.0 and got %s \n", tx->response_status_number, bstr_tocstr(tx->response_message), diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 37c4338a7e..fad4f24500 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -868,9 +868,13 @@ void AppLayerParserCleanupState(TcpSession *ssn) SCLogDebug("no ssn"); return; } + if (ssn->alproto >= ALPROTO_MAX) { + SCLogDebug("app layer proto unknown"); + return; + } AppLayerProto *p = &al_proto_table[ssn->alproto]; - if (p == NULL) { + if (p->name == NULL) { SCLogDebug("no parser state for %"PRIu16"", ssn->alproto); return; } diff --git a/src/util-debug-filters.c b/src/util-debug-filters.c index d9906ce48b..552259c0a9 100644 --- a/src/util-debug-filters.c +++ b/src/util-debug-filters.c @@ -690,7 +690,6 @@ int SCLogCheckFDFilterEntry(const char *function) SCLogFDFilter *curr = NULL; SCLogFDFilterThreadList *thread_list = NULL; - SCLogFDFilterThreadList *thread_list_prev = NULL; SCLogFDFilterThreadList *thread_list_temp = NULL; //pid_t self = syscall(SYS_gettid); @@ -748,10 +747,7 @@ int SCLogCheckFDFilterEntry(const char *function) thread_list_temp->t = self; thread_list_temp->entered++; - if (thread_list_prev == NULL) - sc_log_fd_filters_tl = thread_list_temp; - else - thread_list_prev->next = thread_list_temp; + sc_log_fd_filters_tl = thread_list_temp; SCMutexUnlock(&sc_log_fd_filters_tl_m); @@ -868,12 +864,10 @@ int SCLogAddFDFilter(const char *function) exit(EXIT_FAILURE); } - if (curr == NULL) { - if (sc_log_fd_filters == NULL) - sc_log_fd_filters = temp; - else - prev->next = temp; - } + if (sc_log_fd_filters == NULL) + sc_log_fd_filters = temp; + else + prev->next = temp; SCMutexUnlock(&sc_log_fd_filters_m); sc_log_fd_filters_present = 1;