]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: logs: segfault writing to log from Lua
authorDragan Dosen <ddosen@haproxy.com>
Thu, 1 Oct 2015 11:18:13 +0000 (13:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Oct 2015 22:57:45 +0000 (00:57 +0200)
commit43885c728e7f90f6295a195076833b64ff9bb3fb
treeea6d5f62fa1bb77ce030868ff62a964f25f817a0
parent2dcb9bc5bff9ef64d345378f0bd93c4ff35bfc29
BUG/MEDIUM: logs: segfault writing to log from Lua

Michael Ezzell reported a bug causing haproxy to segfault during startup
when trying to send syslog message from Lua. The function __send_log() can
be called with *p that is NULL and/or when the configuration is not fully
parsed, as is the case with Lua.

This patch fixes this problem by using individual vectors instead of the
pre-generated strings log_htp and log_htp_rfc5424.

Also, this patch fixes a problem causing haproxy to write the wrong pid in
the logs -- the log_htp(_rfc5424) strings were generated at the haproxy
start, but "pid" value would be changed after haproxy is started in
daemon/systemd mode.
include/proto/log.h
include/types/global.h
include/types/log.h
include/types/proxy.h
src/cfgparse.c
src/haproxy.c
src/log.c