]> git.ipfire.org Git - thirdparty/coreutils.git/commit
basenc: fix bug49741: using wrong decoding buffer length
authorAssaf Gordon <assafgordon@gmail.com>
Mon, 16 Aug 2021 21:03:36 +0000 (15:03 -0600)
committerAssaf Gordon <assafgordon@gmail.com>
Mon, 30 Aug 2021 04:06:32 +0000 (22:06 -0600)
commit709d1f8253072804cc27189a6f2b873d8d563399
tree9970648147a1fca9954669c2a83c25fb7fc029c5
parent97d8dcc5ca433471eac0609c0e8d51d40082876f
basenc: fix bug49741: using wrong decoding buffer length

Emil Lundberg <lundberg.emil@gmail.com> reports in
https://bugs.gnu.org/49741 about a 'basenc --base64 -d' decoding bug.
The input buffer length was not divisible by 3, resulting in
decoding errors.

* NEWS: Mention fix.
* src/basenc.c (DEC_BLOCKSIZE): Change from 1024*5 to 4200 (35*3*5*8)
which is divisible by 3,4,5,8 - satisfying both base32 and base64;
Use compile-time verify() macro to enforce the above.
* tests/misc/basenc.pl: Add test.
NEWS
src/basenc.c
tests/misc/basenc.pl