]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: cache: Fix copy of value when parsing maxage
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 May 2026 14:20:34 +0000 (16:20 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jun 2026 07:59:33 +0000 (09:59 +0200)
commitf1aac4a3b28d9c7b94215066da82e448d55288b6
tree747de0c8b320d38676f86746220fbec3b3e991c6
parent3a5189faba1ea1b0c0c618bc47e199af3926d2a6
BUG/MINOR: cache: Fix copy of value when parsing maxage

During maxage parsing, the size of the value was not properly computed when
it was copied into the trash chunk. The name (max-age or s-maxage) must be
skipped with the '=' character. But instead of doing a subtraction, and
addition was performed, adding 2 extra bytes to the value used for the
convertion to integer.

In addition, the "chunk_memcat(chk, "", 1)" operation to add a trailing
NULL-byte was replaced by "*(b_tail(chk)) = '\0'". It a bit easier to
understand.

This patch should be backported to all stable versions.
src/cache.c