From: Victor Julien Date: Wed, 11 Dec 2013 08:44:42 +0000 (+0100) Subject: log-http: fix compiler warning X-Git-Tag: suricata-2.0beta2~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6709fdd8cf4c01146f9cf83c64a1f7efa363fd90;p=thirdparty%2Fsuricata.git log-http: fix compiler warning log-httplog.c:180: warning: 'cvalue' may be used uninitialized in \ this function --- diff --git a/src/log-httplog.c b/src/log-httplog.c index ef87d9f57b..5b836fe0f1 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -177,7 +177,7 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const struct t uint32_t datalen; char buf[128]; - uint8_t *cvalue; + uint8_t *cvalue = NULL; uint32_t cvalue_len = 0; htp_header_t *h_request_hdr; @@ -305,7 +305,7 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const struct t &cvalue); } } - if (cvalue_len > 0) { + if (cvalue_len > 0 && cvalue != NULL) { datalen = httplog_ctx->cf_nodes[i]->maxlen; if (datalen == 0 || datalen > cvalue_len) { datalen = cvalue_len;