From 95d0b71683336979b3cc1633c8b3f6a88b4d7bff Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 16 Oct 2020 10:16:31 +0200 Subject: [PATCH] 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). --- lisp/gnus/gnus-icalendar.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. -- 2.39.2