]> git.eshelyaron.com Git - emacs.git/commitdiff
Be more resilient against invalid headers in mml-generate-mime
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 19 Apr 2022 11:42:17 +0000 (13:42 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 19 Apr 2022 11:42:25 +0000 (13:42 +0200)
* lisp/gnus/mml.el (mml-generate-mime): Don't bug out when called
with invalid headers (bug#55014).

lisp/gnus/mml.el

index 5a526025061a21a9d0e22623c78a8a8d069b2988..093e582ea7a888fea950b798c3b6957ebc80a770 100644 (file)
@@ -500,7 +500,8 @@ type detected."
       (when (and (consp (car cont))
                 (= (length cont) 1)
                 content-type)
-       (setcdr (assq 'type (cdr (car cont))) content-type))
+        (when-let ((spec (assq 'type (cdr (car cont)))))
+         (setcdr spec content-type)))
       (when (fboundp 'libxml-parse-html-region)
        (setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))
       (prog1