Fixing some code reviews (Thanks to Steve Grubb)

remotes/origin/master-1.0.x
Pablo Rincon 16 years ago committed by Victor Julien
parent 86185ecd97
commit f862de2ee6

@ -1271,9 +1271,7 @@ int HTPParserTest05(void) {
goto end; goto end;
} }
if (tx->response_status_number != 200 || if (tx->response_status_number != 200) {
h == NULL || tx->request_protocol_number != HTTP_1_0)
{
printf("expected response 200 OK and got %"PRId32" %s: , expected protocol " printf("expected response 200 OK and got %"PRId32" %s: , expected protocol "
"HTTP/1.0 and got %s \n", tx->response_status_number, "HTTP/1.0 and got %s \n", tx->response_status_number,
bstr_tocstr(tx->response_message), bstr_tocstr(tx->response_message),

@ -868,9 +868,13 @@ void AppLayerParserCleanupState(TcpSession *ssn)
SCLogDebug("no ssn"); SCLogDebug("no ssn");
return; return;
} }
if (ssn->alproto >= ALPROTO_MAX) {
SCLogDebug("app layer proto unknown");
return;
}
AppLayerProto *p = &al_proto_table[ssn->alproto]; AppLayerProto *p = &al_proto_table[ssn->alproto];
if (p == NULL) { if (p->name == NULL) {
SCLogDebug("no parser state for %"PRIu16"", ssn->alproto); SCLogDebug("no parser state for %"PRIu16"", ssn->alproto);
return; return;
} }

@ -690,7 +690,6 @@ int SCLogCheckFDFilterEntry(const char *function)
SCLogFDFilter *curr = NULL; SCLogFDFilter *curr = NULL;
SCLogFDFilterThreadList *thread_list = NULL; SCLogFDFilterThreadList *thread_list = NULL;
SCLogFDFilterThreadList *thread_list_prev = NULL;
SCLogFDFilterThreadList *thread_list_temp = NULL; SCLogFDFilterThreadList *thread_list_temp = NULL;
//pid_t self = syscall(SYS_gettid); //pid_t self = syscall(SYS_gettid);
@ -748,10 +747,7 @@ int SCLogCheckFDFilterEntry(const char *function)
thread_list_temp->t = self; thread_list_temp->t = self;
thread_list_temp->entered++; thread_list_temp->entered++;
if (thread_list_prev == NULL) sc_log_fd_filters_tl = thread_list_temp;
sc_log_fd_filters_tl = thread_list_temp;
else
thread_list_prev->next = thread_list_temp;
SCMutexUnlock(&sc_log_fd_filters_tl_m); SCMutexUnlock(&sc_log_fd_filters_tl_m);
@ -868,12 +864,10 @@ int SCLogAddFDFilter(const char *function)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (curr == NULL) { if (sc_log_fd_filters == NULL)
if (sc_log_fd_filters == NULL) sc_log_fd_filters = temp;
sc_log_fd_filters = temp; else
else prev->next = temp;
prev->next = temp;
}
SCMutexUnlock(&sc_log_fd_filters_m); SCMutexUnlock(&sc_log_fd_filters_m);
sc_log_fd_filters_present = 1; sc_log_fd_filters_present = 1;

Loading…
Cancel
Save