From: Lars Ingebrigtsen Date: Fri, 16 Oct 2020 08:16:31 +0000 (+0200) Subject: Sanitize ical data in gnus-icalendar-event-from-ical X-Git-Tag: emacs-28.0.90~5610 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95d0b71683336979b3cc1633c8b3f6a88b4d7bff;p=emacs.git Sanitize ical data in gnus-icalendar-event-from-ical * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical): Sanitise the data before passing it on to the constructor. This avoids backtraces on icals with extra, unknown slots (bug#43057). --- diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index d7e35c55875..bc1bb838223 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -264,7 +264,14 @@ (map-property ical-property)) args))))) (mapc #'accumulate-args prop-map) - (apply #'make-instance event-class args)))) + (apply + #'make-instance + event-class + (cl-loop for slot in (eieio-class-slots event-class) + for keyword = (intern + (format ":%s" (eieio-slot-descriptor-name slot))) + when (plist-get args keyword) + append (list keyword (plist-get args keyword))))))) (defun gnus-icalendar-event-from-buffer (buf &optional attendee-name-or-email) "Parse RFC5545 iCalendar in buffer BUF and return an event object.