git: DragonFly_RELEASE_6_2 libc/net: Fix b64_pton() for some exact-sized buffer

Aaron LI aly at crater.dragonflybsd.org
Sun May 1 08:29:04 PDT 2022


commit bdf470c4003cab60427283746458a1eddd6486e4
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Apr 30 21:06:40 2022 +0800

    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

Summary of changes:
 lib/libc/net/base64.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bdf470c4003cab60427283746458a1eddd6486e4


-- 
DragonFly BSD source repository


More information about the Commits mailing list