unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10536: 23.3; Make base64-decode more fault tolerant
@ 2012-01-17 14:39 Wolfram Gloger
  2018-04-17 22:22 ` Lars Ingebrigtsen
  2019-06-27 15:42 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 10+ messages in thread
From: Wolfram Gloger @ 2012-01-17 14:39 UTC (permalink / raw)
  To: 10536

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;





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-06-27 17:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 14:39 bug#10536: 23.3; Make base64-decode more fault tolerant Wolfram Gloger
2018-04-17 22:22 ` Lars Ingebrigtsen
2018-04-18  2:25   ` Noam Postavsky
2018-04-18  6:20   ` Eli Zaretskii
2018-04-18  9:42     ` Robert Pluim
2018-04-18  9:48       ` Eli Zaretskii
2018-04-18 11:40     ` Lars Ingebrigtsen
2019-06-27 15:42 ` Lars Ingebrigtsen
2019-06-27 17:16   ` Noam Postavsky
2019-06-27 17:22     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).