From bd6d1bfac4bea5bb93e51c81984112913b287d1c Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Tue, 31 May 2011 19:03:38 -0500 Subject: [PATCH] Fix potential crash in classtype parsing code --- src/stream-tcp-reassemble.c | 4 ++++ src/util-classification-config.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 288f88b348..25e618f16c 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -561,6 +561,10 @@ int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ "ra_app_base_seq %"PRIu32, TCP_GET_SEQ(p), (TCP_GET_SEQ(p)+p->payload_len), stream->last_ack, stream->ra_app_base_seq); + if (seg == NULL) { + goto end; + } + /* fast track */ if (list_seg == NULL) { SCLogDebug("empty list, inserting seg %p seq %" PRIu32 ", " diff --git a/src/util-classification-config.c b/src/util-classification-config.c index 85e5add416..72bcae36f1 100644 --- a/src/util-classification-config.c +++ b/src/util-classification-config.c @@ -236,6 +236,9 @@ int SCClassConfAddClasstype(char *rawstr, uint8_t index, DetectEngineCtx *de_ctx SCLogInfo("pcre_get_substring() failed"); goto error; } + if (ct_priority_str == NULL) { + goto error; + } ct_priority = atoi(ct_priority_str);