From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#42029: `gnus-registry-spool-action' gets field beyond message headers Date: Wed, 24 Jun 2020 10:25:41 -0700 Message-ID: <87o8p8v0iy.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="119802"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42029@debbugs.gnu.org To: tomotaka.suwa@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 24 19:26:12 2020 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 1jo9A4-000V2G-J2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 19:26:12 +0200 Original-Received: from localhost ([::1]:41476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo9A3-0003Tq-Jp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 13:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo99v-0003RE-0M for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 13:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jo99u-0000nd-Nl for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 13:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jo99u-0000IX-E9; Wed, 24 Jun 2020 13:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 24 Jun 2020 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42029 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 42029-submit@debbugs.gnu.org id=B42029.15930195521130 (code B ref 42029); Wed, 24 Jun 2020 17:26:02 +0000 Original-Received: (at 42029) by debbugs.gnu.org; 24 Jun 2020 17:25:52 +0000 Original-Received: from localhost ([127.0.0.1]:38816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo99k-0000I9-EG for submit@debbugs.gnu.org; Wed, 24 Jun 2020 13:25:52 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:46282 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo99h-0000Hv-3B for 42029@debbugs.gnu.org; Wed, 24 Jun 2020 13:25:51 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 96783FA0AC; Wed, 24 Jun 2020 17:25:42 +0000 (UTC) In-Reply-To: (tomotaka suwa's message of "Wed, 24 Jun 2020 20:49:03 +0900") 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:182349 Archived-At: tomotaka.suwa@gmail.com writes: > Hi, > > I've been suffering from `mail-source-crash-box' on getting new mail. > > After some debug and investigation, I noticed that > `mail-extract-address-components' was failing by invalid addresses. > > The issue happened in `gnus-registry-spool-action' and invalid addresses > are passed by calling `message-fetch-field' on the buffer not narrowed > to message headers. > > Below snippet reproduce the root issue: > > (with-temp-buffer > (save-excursion > ;; mail header > (insert "From: from@bar.com\n" > "To: to@bar.com\n" > "Subject: test\n") > (newline) > ;; mail body > (insert "message\n" > "Cc: >,@ \n")) ;; by incorrect decode > (gnus-registry-spool-action 1 "test")) > > In stead of `message-fetch-field', calling `message-field-value' would > solve the problem since it ensures the buffer is narrowed at first. Thanks for this report. It might be simpler to wrap the whole thing in a single save-restriction+narrow-to-headers, since the function gets called four times. What do you think?