]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: look for the end of priority before the end of the buffer
authorWilly Tarreau <w@1wt.eu>
Sat, 23 May 2026 19:14:04 +0000 (21:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 May 2026 08:52:42 +0000 (10:52 +0200)
commit478e7e52cb220075a6c1eb796ca18391189a29ab
treed8039294fe211df0cf653e43590807587eff2b11
parent8e1d33a6481a2e301512c3d3deb7467ade432ebf
BUG/MINOR: log: look for the end of priority before the end of the buffer

In parse_log_message(), the first loop looks for '>' that finishes the
priority field, and unfortunately it stops once it has checked the first
byte after the end of the buffer. This means that a priority made only
of digits for the whole buffer would read one extra byte. In practice
since pools have a tag at the end this is only detectable when using ASAN,
but this should be fixed nevertheless.

This can be backported to all versions.

It's worth noting that RFC5424 now says that the PRI field is 1..3
digits only, so maybe at some point we could seriously limit the
length as well.
src/log.c