]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: segfault if there are no proxy reference
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 9 Mar 2015 16:10:29 +0000 (17:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Mar 2015 17:46:48 +0000 (18:46 +0100)
The HAProxy API allow to send log without defined proxy (it
set to the NULL value). An incomplete test if done to choose
the log tag and an invalid pointer is dereferenced.

src/log.c

index 6c01248e39cce379f2689c920987a7962444ca83..f7d160dcfd70ee6ad84bcbf37657b960bbfc70d6 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -775,7 +775,7 @@ void send_log(struct proxy *p, int level, const char *format, ...)
        if (level < 0 || format == NULL || logline == NULL)
                return;
 
-       dataptr = update_log_hdr(p->log_tag ? p->log_tag : global.log_tag); /* update log header and skip it */
+       dataptr = update_log_hdr(p && p->log_tag ? p->log_tag : global.log_tag); /* update log header and skip it */
        data_len = dataptr - logline;
 
        va_start(argp, format);