]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix the segmentation fault while logging the host on the custom HTTP logger.
authorDuarte Silva <development@serializing.me>
Thu, 19 Dec 2013 14:07:30 +0000 (14:07 +0000)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2014 13:47:07 +0000 (14:47 +0100)
- 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

src/log-httplog.c

index 48d860dad4e5b41b06626cc72f305de32a457417..8d8a930701d2a3564c9cbb189c8dc245ce4c084a 100644 (file)
@@ -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),