]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: possible integer underflow in acme_txt_record()
authorWilliam Lallemand <wlallemand@irq6.net>
Sun, 3 Aug 2025 11:51:44 +0000 (13:51 +0200)
committerWilliam Lallemand <wlallemand@irq6.net>
Tue, 5 Aug 2025 10:12:50 +0000 (12:12 +0200)
commit66f28dbd3fb824ec7c2c6352616a7a335cb2b012
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