]> git.eshelyaron.com Git - emacs.git/commitdiff
Sanitize ical data in gnus-icalendar-event-from-ical
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 16 Oct 2020 08:16:31 +0000 (10:16 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 16 Oct 2020 08:16:31 +0000 (10:16 +0200)
* 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

index d7e35c558759b1f14e5b01bd1c0fe8f587267f02..bc1bb83822303ae79eed754f93195c8f11bebbbc 100644 (file)
                                (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.