]> git.eshelyaron.com Git - emacs.git/commitdiff
Ignore invalid base64 encoded embedded images
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 12:57:11 +0000 (13:57 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 12:57:11 +0000 (13:57 +0100)
* lisp/net/shr.el (shr-image-from-data): Ignore invalid base64
encoded embedded images (bug#22928).

lisp/net/shr.el

index 4f64618c00804be416a0c36173c289f2a2a2a52f..cd55f223cf692fa93edb181ffaa8cfa951278ab2 100644 (file)
@@ -946,7 +946,8 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
     (let ((param (match-string 4 data))
          (payload (url-unhex-string (match-string 5 data))))
       (when (string-match "^.*\\(;[ \t]*base64\\)$" param)
-       (setq payload (base64-decode-string payload)))
+       (setq payload (ignore-errors
+                        (base64-decode-string payload))))
       payload)))
 
 ;; Behind display-graphic-p test.