]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG: errors: remove printf positional args for user messages context
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 7 Jun 2021 17:24:10 +0000 (19:24 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Jun 2021 09:40:44 +0000 (11:40 +0200)
commit846830e47d9b8130e353c59f6fdea09c26b64d81
treeb47727028c74fec947cf8a6fc85b6d1a5ccdd9cd
parentfc0cceb08a5e11a5e767e3a1d4d44901c454a850
BUG: errors: remove printf positional args for user messages context

Change the algorithm for the generation of the user messages context
prefix. Remove the dubious API relying on optional printf positional
arguments. This may be non portable, and in fact the CI glibc crashes
with the following error when some arguments are not present in the
format string :

"invalid %N$ use detected".

Now, a fixed buffer attached to the context instance is allocated once
for the program lifetime. Then call repeatedly snprintf with the
optional arguments of context if present to build the context string.
The buffer is deallocated via a per-thread free handler.

This does not need to be backported.
include/haproxy/errors.h
src/errors.c