GNU bug report logs - #10536
23.3; Make base64-decode more fault tolerant

Previous Next

Package: emacs;

Reported by: Wolfram Gloger <wmglo <at> dent.med.uni-muenchen.de>

Date: Tue, 17 Jan 2012 17:09:02 UTC

Severity: minor

Tags: patch, wontfix

Found in version 23.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Wolfram Gloger <wmglo <at> dent.med.uni-muenchen.de>
To: 10536 <at> debbugs.gnu.org
Subject: bug#10536: 23.3; Make base64-decode more fault tolerant
Date: Tue, 17 Jan 2012 15:39:20 +0100
Hello,

Not a bug in Emacs, but I have received base64-encoded mails from a
not-so-small company which could not be decoded.  It turns out that
there was a missing padding character, i.e. the last quartet was
"xy=" rather than the proper "xy==".

I would suggest that base64-decode should tolerate this, like with
the appended patch.

Regards,
Wolfram.

--- src/fns.c~	2011-04-05 05:46:44.000000000 +0200
+++ src/fns.c	2012-01-17 13:59:26.000000000 +0100
@@ -3590,7 +3590,8 @@
 
       if (c == '=')
 	{
-	  READ_QUADRUPLET_BYTE (-1);
+	  /* Be tolerant against missing final padding '='.  */
+	  READ_QUADRUPLET_BYTE (e-to);
 
 	  if (c != '=')
 	    return -1;




This bug report was last modified 6 years and 22 days ago.

Previous Next


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