Subject: A bug while trying to decode a non encode base64

From: vardhaman narasagoudar <[email-masked]>
Date: Wed, 20 Nov 2019 16:46:45 +0530

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@oc6085028360 ~]$ echo  'Nzc3Nzk5Cg==' | base64 --decode
777799
[vardhaman@oc6085028360 ~]$ echo $?
0

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

3) Now trying to decode a non-encoded value of 12characters
[vardhaman@oc6085028360 ~]$ echo  'vardhamanbn1' | base64 --decode
��݅�����[vardhaman@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@oc6085028360 ~]$ base64 --version
base64 (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.

-- 
Thanks & Regards
Vardhaman B.N
9945840928