From: Lars Ingebrigtsen Date: Tue, 19 Apr 2022 11:42:17 +0000 (+0200) Subject: Be more resilient against invalid headers in mml-generate-mime X-Git-Tag: emacs-29.0.90~1931^2~406 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=843dc435f797e6804663ae074d3d88993c4cd8a4;p=emacs.git Be more resilient against invalid headers in mml-generate-mime * lisp/gnus/mml.el (mml-generate-mime): Don't bug out when called with invalid headers (bug#55014). --- diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 5a526025061..093e582ea7a 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -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