3bf574a9 | 30-Apr-2022 |
Aaron LI <aly@aaronly.me> |
libc/net: Fix b64_pton() for some exact-sized buffer
When decoding a base64 string with padding, b64_pton() can fail when the output buffer is exactly the needed size. For example, decoding the fol
libc/net: Fix b64_pton() for some exact-sized buffer
When decoding a base64 string with padding, b64_pton() can fail when the output buffer is exactly the needed size. For example, decoding the following base64 string to buffer[32] would fail:
% dd if=/dev/random bs=32 count=1 | base64 FCiWkKuhdRq3tMmtAt9CpchTTYMlIW3U3gJsavDNxZI=
This commit fixes the above issue.
Reported-by: dczheng Obtained-from: OpenBSD See also: FreeBSD revision 275060, https://reviews.freebsd.org/D1218
show more ...
|