]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: log-format: fix possible endless loop in parse_logformat_string()
authorDragan Dosen <ddosen@haproxy.com>
Tue, 30 Jun 2020 19:16:43 +0000 (21:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 Jul 2020 04:30:50 +0000 (06:30 +0200)
This patch adds a missing break to end the loop in case when '%[' is not
properly closed with ']'.

The issue has been introduced with commit cd0d2ed ("MEDIUM: log-format:
make the LF parser aware of sample expressions' end").

src/log.c

index 385bfc71ec0721e173deeffaed1b494c2e878f6b..f2480b436718b75db446d3592715085f9ea388a8 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -683,6 +683,7 @@ int parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
                                        memprintf(err, "expected ']' after '%s', but found '%c'", var, c);
                                else
                                        memprintf(err, "missing ']' after '%s'", var);
+                               goto fail;
                        }
                        break;