Commit 55dde6c1 authored by Peder O. Klingenberg's avatar Peder O. Klingenberg Committed by Noam Postavsky
Browse files

Avoid error in icalendar--read-element

* lisp/calendar/icalendar.el (icalendar--read-element): Avoid a regex
stack overflow by not using regex to extract values from calendar
events. (Bug#24315)
parent 32078ec8
......@@ -361,7 +361,8 @@ Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to
INVALUE gives the current iCalendar element we are reading.
INPARAMS gives the current parameters.....
This function calls itself recursively for each nested calendar element
it finds."
it finds. The current buffer should be an unfolded buffer as returned
from `icalendar--get-unfolded-buffer'."
(let (element children line name params param param-name param-value
(continue t))
......@@ -391,8 +392,9 @@ it finds."
(unless (looking-at ":")
(error "Oops"))
(forward-char 1)
(re-search-forward "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t)
(setq value (icalendar--rris "\r?\n[ \t]" "" (match-string 0)))
(let ((start (point)))
(setq value (buffer-substring start (point))))
(setq line (list name params value))
(cond ((eq name 'BEGIN)
(setq children
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment