]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: log-forward: make sure the month is unsigned
authorWilly Tarreau <w@1wt.eu>
Sat, 23 May 2026 18:17:16 +0000 (20:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 May 2026 08:16:06 +0000 (10:16 +0200)
commitf9088a5d7500ebb39deff7c839817977c1b1d11c
tree4c2357772ab5c9fc422274aabc2092c58f69dbce
parent007d5946b425bdbfccde76b89e05471ff91b738c
BUG/MEDIUM: log-forward: make sure the month is unsigned

In 2.3, in preparation for log forwarding, commit 546488559 ("MEDIUM:
log/sink: re-work and merge of build message API.") extended the log
send API to be able to use metadata from an existing header. However
the month number is parsed from the passed meta-data and compared
against 11 but there's no check for negative values which could in
theory cause a negative monthname[] index.

It can be a problem when the date is received as RFC5424 and forced
to RFC3164 because certain characters in the month field could result
in a negative month value. Let's fix it by turning the month to unsigned
to make sure we only accept months 0..11.

This should be backported to all branches.
src/log.c