]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
xff: fix address overwrite in forward case
authorEric Leblond <eric@regit.org>
Thu, 11 Feb 2016 10:44:12 +0000 (11:44 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 25 Feb 2016 09:36:32 +0000 (10:36 +0100)
src/app-layer-htp-xff.c

index 96c6de487f751e47976c4be6ab4e5fc0bc330ea9..edc5168eea8f713ef02d8a6ca132f2650540c9e6 100644 (file)
@@ -160,7 +160,7 @@ int HttpXFFGetIPFromTx(const Packet *p, uint64_t tx_id, HttpXFFCfg *xff_cfg,
             /** Get the first IP address from the chain */
             p_xff = memchr(xff_chain, ',', bstr_len(h_xff->value));
             if (p_xff != NULL) {
-                xff_chain[bstr_len(h_xff->value) - (p_xff - xff_chain)]=0;
+                *p_xff = 0;
             }
             p_xff = xff_chain;
         }