GNU bug report logs - #79184
base32/base64: different behavior of -d with invalid input

Previous Next

Package: coreutils;

Reported by: Daniel Hofstetter <dhofstet <at> gmail.com>

Date: Wed, 6 Aug 2025 16:05:01 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Full log


Message #8 received at 79184 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Daniel Hofstetter <dhofstet <at> gmail.com>
Cc: 79184 <at> debbugs.gnu.org
Subject: Re: bug#79184: base32/base64: different behavior of -d with invalid
 input
Date: Wed, 6 Aug 2025 10:17:32 -0700
On 2025-08-06 09:04, Daniel Hofstetter wrote:
> $ echo 'invalid' | base32 -d 2> /dev/null
> $ echo 'invalid' | base32 -d > /dev/null
> base32: invalid input
> $ echo 'invalid' | base64 -d 2> /dev/null
> �{ږ'$
> $ echo 'invalid' | base64 -d > /dev/null
> base64: invalid input

I don't see a bug here. Both programs convert as much as they can, and 
then stop and diagnose a failure if there is one. base32 can't convert 
anything, so it stops right away. base64 can convert the 'inva' as 
that's valid base64 input, so it outputs the converted data before 
finding the "lid\n" which is invalid.




This bug report was last modified 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.