From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: peder@klingenberg.no (Peder O. Klingenberg) Newsgroups: gmane.emacs.bugs Subject: bug#24315: 25.1.50; re-search-forward errors with "Variable binding depth exceeds max-specpdl-size" Date: Fri, 02 Sep 2016 15:45:34 +0200 Organization: Persons in a Position to Know, inc. Message-ID: References: <87twe6sx2g.fsf@users.sourceforge.net> <87poonoyer.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1472824281 16878 195.159.176.226 (2 Sep 2016 13:51:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Sep 2016 13:51:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: 24315@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 02 15:51:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfosH-0003vW-GJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Sep 2016 15:51:17 +0200 Original-Received: from localhost ([::1]:42370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfosF-0006lg-08 for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Sep 2016 09:51:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfos8-0006lP-QO for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:51:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfos2-0006SI-NQ for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:51:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfos2-0006S9-Kz for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bfos2-00009q-Fj for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:51:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: peder@klingenberg.no (Peder O. Klingenberg) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Sep 2016 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24315 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1472824241575 (code B ref -1); Fri, 02 Sep 2016 13:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2016 13:50:41 +0000 Original-Received: from localhost ([127.0.0.1]:47119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bforg-00009D-Mt for submit@debbugs.gnu.org; Fri, 02 Sep 2016 09:50:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bforf-000090-7z for submit@debbugs.gnu.org; Fri, 02 Sep 2016 09:50:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bforS-0006OS-HK for submit@debbugs.gnu.org; Fri, 02 Sep 2016 09:50:30 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bforS-0006OM-Ei for submit@debbugs.gnu.org; Fri, 02 Sep 2016 09:50:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bforP-0006jt-UG for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:50:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bforK-0006NV-Bz for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:50:22 -0400 Original-Received: from [195.159.176.226] (port=50240 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bforK-0006NC-47 for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 09:50:18 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bfor7-000507-8Q for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2016 15:50:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 70 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:fAmmJTa0o7aHD208gAYcMPcRrJM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122861 Archived-At: --=-=-= Content-Type: text/plain On Thu, Sep 01 2016 at 21:58, npostavs@users.sourceforge.net wrote: >> -it finds." >> +it finds. The current buffer should be an unfolded buffer as returned > ^ > Sentences should be double spaced. Gah! And I'm usually chided for using old-fashioned double spaces in prose. :) > Might be better to avoid finding the end of line twice (since apparently > 40k lines do happen, I guess it's worth thinking a bit about > optimizing): Even finding the the end of the line twice was faster than the regexp method, subjectively. On my problematic 40k line, it did not take noticable time, whereas the regexp caused a bit of a delay even on shorter events. But I agree, let's not make emacs do more work than necessary. Updated patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=bug24315.patch >From b51d09286492ae9be32b3718407174236db54059 Mon Sep 17 00:00:00 2001 From: "Peder O. Klingenberg" Date: Tue, 30 Aug 2016 14:44:16 +0200 Subject: [PATCH] Avoid crash in icalendar--read-element * lisp/calendar/icalendar.el (icalendar--read-element): Stop crashing when parsing overly long event descriptions. (Bug#24315) --- lisp/calendar/icalendar.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 386c554..c88f4ab 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -361,7 +361,8 @@ icalendar--read-element 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 value (continue t)) @@ -391,8 +392,9 @@ icalendar--read-element (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))) + (end-of-line) + (setq value (buffer-substring start (point)))) (setq line (list name params value)) (cond ((eq name 'BEGIN) (setq children -- 2.9.3 --=-=-=--