Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7632540B95B for ; Fri, 16 Jul 2010 04:33:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y60vEewHnGFz for ; Fri, 16 Jul 2010 04:32:59 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id B4B0D40B95D for ; Fri, 16 Jul 2010 04:32:59 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id CCF8919F33D7; Fri, 16 Jul 2010 13:32:58 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id z3X13Mb1ug0E; Fri, 16 Jul 2010 13:32:57 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id A451F19F33A8; Fri, 16 Jul 2010 13:32:57 +0200 (CEST) Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 9EFE615C027; Fri, 16 Jul 2010 13:32:57 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1OZjA1-0000oe-B3; Fri, 16 Jul 2010 13:32:57 +0200 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Fix stack overflow in notmuch-wash-tidy-citations Date: Fri, 16 Jul 2010 13:32:35 +0200 Message-Id: <1279279955-3110-1-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1.3.g75e44 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 11:33:10 -0000 The following message (146 kB) breaks the emacs interface: http://rtime.felk.cvut.cz/~sojka/notmuch/notmuch-wash-tidy-citations-stack-overflow.txt An attempt to view the message produced message "notmuch-wash-tidy-citations: Stack overflow in regexp matcherq" and it was not possible to work with the message. I tracked the problem down to the regexp search, which probably attempts to match a very big piece of text (several lines). I changed the regexp to only match a single line. The result is probably slower, but doesn't produce the error. --- emacs/notmuch-wash.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 26a3f88..051dd17 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -218,7 +218,7 @@ Perform four transformations on the message body: ;; Insert a blank line before a citation if there isn't one. (goto-char (point-min)) - (while (re-search-forward "\\(^[^>]+\\)\n>" nil t) + (while (re-search-forward "\\(^[^>][^\n]+\\)\n>" nil t) (replace-match "\\1\n\n>")) ;; Insert a blank line after a citation if there isn't one. -- 1.7.1.3.g75e44