From d35dd1c4ea7f102e7b70b40017a0e1e250dff0cd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 28 Dec 2009 13:58:19 +0100 Subject: [PATCH] Improve http cookie htp state checking before using it. --- src/detect-http-cookie.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/detect-http-cookie.c b/src/detect-http-cookie.c index bf1c6ef2cb..c67c5e6621 100644 --- a/src/detect-http-cookie.c +++ b/src/detect-http-cookie.c @@ -75,12 +75,13 @@ int DetectHttpCookieMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, return 0; } - if (htp_state->connp->conn == NULL) { + int ret = 0; + SCMutexLock(&f->m); + if (htp_state->connp == NULL && htp_state->connp->conn == NULL) { SCLogDebug("HTTP connection structure is NULL"); return 0; } - int ret = 0; - SCMutexLock(&f->m); + htp_tx_t *tx = list_get(htp_state->connp->conn->transactions, 0); if (tx == NULL) {