]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: fix a typo that would cause %HP to log <BADREQ>
authorNenad Merdanovic <nmerdan@anine.io>
Mon, 25 Apr 2016 23:39:02 +0000 (01:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Apr 2016 05:28:44 +0000 (07:28 +0200)
Typo was introduced in 57bc891 ("BUG/MEDIUM: log: fix risk of
segfault when logging HTTP fields in TCP mode") which inverted the
condition in the test and caused <BADREQ> to be logged when using
%HP.

Signed-off-by: Nenad Merdanovic <nmerdan@anine.io>
src/log.c

index dffef54150f2b468f5f37146d5ceeefdd028d850..2d022470420a4dd35bc95a55c909b37c04123faa 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1917,7 +1917,7 @@ int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list
                                while (spc < end && *spc != '?' && !HTTP_IS_SPHT(*spc))
                                        spc++;
 
-                               if (!txn || txn->uri || nspaces == 0) {
+                               if (!txn || !txn->uri || nspaces == 0) {
                                        chunk.str = "<BADREQ>";
                                        chunk.len = strlen("<BADREQ>");
                                } else {