GNU bug report logs - #38299
A bug while trying to decode a non encode base64

Previous Next

Package: coreutils;

Reported by: vardhaman narasagoudar <vardhamanbn <at> gmail.com>

Date: Wed, 20 Nov 2019 13:25:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: vardhaman narasagoudar <vardhamanbn <at> gmail.com>
To: 38299 <at> debbugs.gnu.org
Cc: vijay.chaos <at> gmail.com
Subject: bug#38299: A bug while trying to decode a non encode base64
Date: Wed, 20 Nov 2019 16:46:45 +0530
[Message part 1 (text/plain, inline)]
Hi Team,

Looks like there is a bug while trying to decode a non-encode base64 for 12
characters (or multiple of 12) , the return code is always 0.

e.g:-

1) When trying to decode a encoded value
[vardhaman <at> oc6085028360 ~]$ echo  'Nzc3Nzk5Cg==' | base64 --decode
777799
[vardhaman <at> oc6085028360 ~]$ echo $?
0

2)   A sample when trying to decode a non-encode value
[vardhaman <at> oc6085028360 ~]$ echo  '777799' | base64 --decode
����base64: invalid input
[vardhaman <at> oc6085028360 ~]$ echo $?
1


3) Now trying to decode a non-encoded value of 12characters
[vardhaman <at> oc6085028360 ~]$ echo  'vardhamanbn1' | base64 --decode
��݅�����[vardhaman <at> oc6085028360 ~]$ echo $?
0

The point 3 should return code as 1 , as invalid input

I feel this bug is present in all version , anywhere sharing the current
version where I tested

vardhaman <at> oc6085028360 ~]$ base64 --version
base64 (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.



-- 
Thanks & Regards
Vardhaman B.N
9945840928
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 241 days ago.

Previous Next


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