From: Duarte Silva Date: Thu, 19 Dec 2013 14:07:30 +0000 (+0000) Subject: Fix the segmentation fault while logging the host on the custom HTTP logger. X-Git-Tag: suricata-2.0rc1~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa6b5b406d65a6f3e63422071eb7623868adfa25;p=thirdparty%2Fsuricata.git Fix the segmentation fault while logging the host on the custom HTTP logger. - Seems to be a regression introduced in the commit 796bfab2317699779bb0d7dca257bb97083399d8 (fix was already done in commit ee0b21652b00f9398869b097c3ddceb9f86600a9) - Doesn't happen with htplib v0.5.6, but it does in the latest, v0.5.9 --- diff --git a/src/log-httplog.c b/src/log-httplog.c index 48d860dad4..8d8a930701 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -259,8 +259,8 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const struct t if (tx->request_hostname != NULL) { datalen = httplog_ctx->cf_nodes[i]->maxlen; - if (datalen == 0 || datalen > bstr_len(tx->parsed_uri->hostname)) { - datalen = bstr_len(tx->parsed_uri->hostname); + if (datalen == 0 || datalen > bstr_len(tx->request_hostname)) { + datalen = bstr_len(tx->request_hostname); } PrintRawUriBuf((char *)aft->buffer->buffer, &aft->buffer->offset, aft->buffer->size, (uint8_t *)bstr_ptr(tx->request_hostname),