From e83766afd1c5fc77f74698183fe174907cbc323f Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Mon, 9 Mar 2015 17:10:29 +0100 Subject: [PATCH] BUG/MINOR: log: segfault if there are no proxy reference 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 6c01248e3..f7d160dcf 100644 --- 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);