]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: possible integer underflow in acme_txt_record() master
authorWilliam Lallemand <wlallemand@irq6.net>
Sun, 3 Aug 2025 11:51:44 +0000 (13:51 +0200)
committerWilliam Lallemand <wlallemand@irq6.net>
Sun, 3 Aug 2025 12:09:57 +0000 (14:09 +0200)
commitf5e262fc523dfed13486ca93331fb32ee1a8f6d3
tree9270257173b54b36c298032df617ef4de037403e
parent8afd3e588d09f16313b4f9ea1b1a87f829e9b75e
BUG/MINOR: acme: possible integer underflow in acme_txt_record()

a2base64url() can return a negative value is olen is too short to
accept ilen. This is not supposed to happen since the sha256 should
always fit in a buffer. But this is confusing since a2base64()
returns a signed integer which is pt in output->data which is unsigned.

Fix the issue by setting ret to 0 instead of -1 upon error. And returns
a unsigned integer instead of a signed one.
This patch also checks the return value from the caller in order
to emit an error instead of setting trash.data which is already done
from the function.
src/acme.c