]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
bug 418 - update http log to escape backslashes
authorAnoop Saldanha <poonaatsoc@gmail.com>
Fri, 4 May 2012 16:11:51 +0000 (21:41 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 16 May 2012 09:21:05 +0000 (11:21 +0200)
src/util-print.c

index 87d216f21bf7fda81b9689d0f13e36593e112aef..31b8f53d37a3e3a1b7a6c2777023466c7d22be17 100644 (file)
@@ -119,8 +119,13 @@ void PrintRawUriBuf(char *retbuf, uint32_t *offset, uint32_t retbuflen,
 
     for (u = 0; u < buflen; u++) {
         if (isprint(buf[u]) && buf[u] != '\"') {
-            PrintBufferData(retbuf, offset, retbuflen,
-                            "%c", buf[u]);
+            if (buf[u] == '\\') {
+                PrintBufferData(retbuf, offset, retbuflen,
+                                "\\\\");
+            } else {
+                PrintBufferData(retbuf, offset, retbuflen,
+                                "%c", buf[u]);
+            }
         } else {
             PrintBufferData(retbuf, offset, retbuflen,
                             "\\x%02X", buf[u]);