]> git.ipfire.org Git - thirdparty/coreutils.git/commit
basenc: ensure partial padding with newlines induces an error
authorPádraig Brady <P@draigBrady.com>
Mon, 8 Sep 2025 17:22:20 +0000 (18:22 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 8 Sep 2025 18:39:47 +0000 (19:39 +0100)
commitd9b68362edcb509ecb00cf900617f55574212a96
tree08de6f897a9ed0a9ef3b8e7c1428555118387c1a
parent42c4578b49afaf3dc8de884262f34e4a19066860
basenc: ensure partial padding with newlines induces an error

* src/basenc.c (has_padding): A more robust helper to
identify padding in the presence of trailing newlines.
(do_decode): Use has_padding() rather than just looking
at the last character.
* tests/basenc/base64.pl: Fully test commit v9.4-53-g378dc38f4
by ensuring partially padded data is diagnosed.
baddecode9 is the case fixed in this commit.
* NEWS: Mention the bug fix.
NEWS
src/basenc.c
tests/basenc/base64.pl