From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nick Gasson Newsgroups: gmane.emacs.bugs Subject: bug#49770: [PATCH] rmailsum: error when message contains no From header Date: Thu, 29 Jul 2021 21:24:13 +0800 Message-ID: <20210729132413.42158-1-nick@nickg.me.uk> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1790"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Nick Gasson To: 49770@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 29 16:35:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m977u-0000Fj-Gr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Jul 2021 16:35:10 +0200 Original-Received: from localhost ([::1]:56460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m977s-0001yW-VJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Jul 2021 10:35:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m977m-0001yK-QB for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2021 10:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m977m-0005vf-ID for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2021 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m977m-0007vy-CW for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2021 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nick Gasson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jul 2021 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49770 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.162756926830452 (code B ref -1); Thu, 29 Jul 2021 14:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jul 2021 14:34:28 +0000 Original-Received: from localhost ([127.0.0.1]:57932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m977D-0007v4-D7 for submit@debbugs.gnu.org; Thu, 29 Jul 2021 10:34:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m96Hu-0006Mf-0l for submit@debbugs.gnu.org; Thu, 29 Jul 2021 09:41:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m96Hr-0007iR-G5 for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2021 09:41:25 -0400 Original-Received: from outmail148111.authsmtp.net ([62.13.148.111]:32917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m96Hp-0002mF-9L for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2021 09:41:22 -0400 Original-Received: from punt22.authsmtp.com (punt22.authsmtp.com [62.13.128.207]) by punt15.authsmtp.com. (8.15.2/8.15.2) with ESMTP id 16TDPZd8086252 for ; Thu, 29 Jul 2021 14:25:35 +0100 (BST) (envelope-from nick@nickg.me.uk) Original-Received: from mail-c237.authsmtp.com (mail-c237.authsmtp.com [62.13.128.237]) by punt22.authsmtp.com. (8.15.2/8.15.2) with ESMTP id 16TDPZGC049409 for ; Thu, 29 Jul 2021 14:25:35 +0100 (BST) (envelope-from nick@nickg.me.uk) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nickg.me.uk; s=authsmtp; t=1627565135; bh=xFbhgUQfEk6QSrdWxPvBwA/7eBkxyRDKOR/h4YTPyF0=; h=Date:From:To:Subject; b=yN412vG4OTJJV2jBmwf0qc9aaU+QgOYUljq9XkxE91FUxaMQ+CbOlis4MxHxng+55 DODCc4rsygdhE2VxAcxfvxv613U/0mCugNazkfUP6zC4/ClWC+pnlqeDdGGg2aQjWl nEwKgsQF5BsrmHVb7DhJz+lM7ehYLqXn+hidOZM8= Original-Received: from asterix.nickg.me.uk (asterix.nickg.me.uk [85.119.83.229]) (authenticated bits=0) by mail.authsmtp.com (8.15.2/8.15.2) with ESMTPSA id 16TDPYFh075667 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 29 Jul 2021 14:25:34 +0100 (BST) (envelope-from nick@nickg.me.uk) Original-Received: from bertha.local (unknown [101.229.124.186]) by asterix.nickg.me.uk (Postfix) with ESMTPSA id 608AD8624A; Thu, 29 Jul 2021 13:25:33 +0000 (UTC) Original-Received: from localhost (bertha.local [local]) by bertha.local (OpenSMTPD) with ESMTPA id 8a028dd9; Thu, 29 Jul 2021 13:25:30 +0000 (UTC) X-Mailer: git-send-email 2.30.2 X-Server-Quench: 748b41c0-f070-11eb-ba2e-8434971169dc X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd0YgkXC1ZTTQ8Z IiUFByxPDwAoYABP FxUeIk5VJkdMWAFY OV1yIVxOdloGSkcD CnlxHghLUl1zWHN0 bwBTaA9eZgRGWhtr UUFXSlFMFgdhHhkJ AQEfHBh0E3EmEQgo ZUFnWHZcEkZ6dEcz RUpcR2kHNmd9PmAY UF1ZdlYGbVEbfEpY YlR8UHoKYGQBby4z CTwLFgwaHQAXMiFc QwUWMFdACUsRBDkm Dw8CEDNnGEAeXCw8 IlQtLVgAFUcXKQ00 NhMPQ1Udex8fAwFT BSkA X-Authentic-SMTP: 61633732313238.1024:7600 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Received-SPF: pass client-ip=62.13.148.111; envelope-from=nick@nickg.me.uk; helo=outmail148111.authsmtp.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 29 Jul 2021 10:34:25 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210856 Archived-At: If you open a mbox file in rmail-mode containing a message without a "From" header and press "h" to display the summary, the following error occurs: Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("\n" nil) rmail-header-summary() rmail-create-summary(1 nil nil 101) rmail-create-summary-line(1) rmail-get-summary(1) rmail-new-summary-1("All" (rmail-summary) nil nil) rmail-new-summary("All" (rmail-summary) nil) rmail-summary() funcall-interactively(rmail-summary) call-interactively(rmail-summary nil nil) * lisp/mail/rmailsum.el (rmail-header-summary): Check if from header is set before scanning it for newlines. --- lisp/mail/rmailsum.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 44cff21b0628..436bc78250cb 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -758,7 +758,7 @@ rmail-header-summary len mch lo newline) ;; If there are multiple lines in FROM, ;; discard up to the last newline in it. - (while (setq newline (string-match "\n" from)) + (while (and from (setq newline (string-match "\n" from))) (setq from (substring from (1+ newline)))) (if (or (null from) (string-match -- 2.30.2