From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: tomotaka.suwa@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#42029: `gnus-registry-spool-action' gets field beyond message headers Date: Wed, 24 Jun 2020 20:49:03 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="52626"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) To: 42029@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 24 13:52:19 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 1jo3wx-000DbI-Ho for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 13:52:19 +0200 Original-Received: from localhost ([::1]:49850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo3ww-0002wM-Io for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 07:52:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo3wg-0002vT-V9 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 07:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jo3wg-0008JG-MT for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 07:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jo3wg-0000aD-I1; Wed, 24 Jun 2020 07:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: tomotaka.suwa@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 24 Jun 2020 11:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42029 X-GNU-PR-Package: emacs,gnus X-Debbugs-Original-To: submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys) Original-Received: via spool by submit@debbugs.gnu.org id=B.15929994692168 (code B ref -1); Wed, 24 Jun 2020 11:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2020 11:51:09 +0000 Original-Received: from localhost ([127.0.0.1]:37901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo3vo-0000Yo-LE for submit@debbugs.gnu.org; Wed, 24 Jun 2020 07:51:09 -0400 Original-Received: from mail-pg1-f172.google.com ([209.85.215.172]:45249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo3u1-0000VW-FJ for submit@debbugs.gnu.org; Wed, 24 Jun 2020 07:49:21 -0400 Original-Received: by mail-pg1-f172.google.com with SMTP id l63so1289428pge.12 for ; Wed, 24 Jun 2020 04:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=n9TDiPPvsy22cscvP2J/BRqHHCM7IQu0vKouWwARP58=; b=mmLWs3fEFP8ZtkSFdn4bfjsD5CAUDPwjcJLJp1zBgoz+L5e4s4j4oBk7TLQQ7578sJ /YtaodgzeiX04g/OPVqfNV5hGUSW1fwSDQ0QKRCWbq6a6fswaYRdZb5BJvwHoPMTwjv2 Pd20ox9g1PQqgCVe7yoUOrCel9sI4p+byqcbsOIaVhMGxvQ03GpkNXa04E7XrSGDNyw0 v+MaXdmtAtqCX+nDMTkn/etZrmk7h8TKLPkfmaLCfFdz0WwmH3p8PPtvMRx0H2aljI5T YtpTxZulmf8SE/05wQkTHaVszvYdtQeG5av9iXQ++vbUux/+BsKkpTA1IZws63w9YrDx Avzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=n9TDiPPvsy22cscvP2J/BRqHHCM7IQu0vKouWwARP58=; b=SG+WQvKERigEUrcVYSyXfUpmtuc1xUAGFijuq+XtvO9wqm/4yUdMIaEVkSLNU8KQ// JbfRlvdrjGSzViLwoGnaypQOMn1bErQhuoqdcPyWZpjpqjl8bgVCpvicVlHv8zUPBhpu uuGQQIYF+AOYlbYoJQwxo7DZuVY/dhWt9qe5gP+WK3ZHCPfsMY2F/gK9O+VJq44Nz+ya H7hFKNAxuVroQzgCnkctspwsXwpIFzOOvriZXuHstySht4/jlSa6MD1i1Vo7hUtoO3kV XbYTuE7X9bWEVbkJ1eQIS5LmsfTUnAznxVjs2H+Di0X1LSYOPcRQVH7ilWpzk9FSgP0g ERwg== X-Gm-Message-State: AOAM531S7OOglg3ex5vFHUv2jVJGzsmOO+N02/ha9pnJTK0KiDnXPc4I PvfPf886/AmW0vw3iLElRdG4Rhoj X-Google-Smtp-Source: ABdhPJzgw+6goBr/zK3FuQZcBnO5Q9k0iRoO/vaf1Kd7G9TA5maXgfy7SiMqrjl3+NMLQm08SdNrwQ== X-Received: by 2002:a62:3645:: with SMTP id d66mr30233944pfa.275.1592999351012; Wed, 24 Jun 2020 04:49:11 -0700 (PDT) Original-Received: from 17C30-A04 ([210.167.63.193]) by smtp.gmail.com with ESMTPSA id v7sm19211919pfn.147.2020.06.24.04.49.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2020 04:49:10 -0700 (PDT) X-Mailman-Approved-At: Wed, 24 Jun 2020 07:51:07 -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:182335 Archived-At: 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. diff -u "d:/msys64/mingw64/share/emacs/26.3/lisp/gnus/gnus-registry.el.orig" "d:/msys64/mingw64/share/emacs/26.3/lisp/gnus/gnus-registry.el" --- d:/msys64/mingw64/share/emacs/26.3/lisp/gnus/gnus-registry.el.orig 2020-06-24 11:10:49.458397900 +0900 +++ d:/msys64/mingw64/share/emacs/26.3/lisp/gnus/gnus-registry.el 2020-06-23 11:08:23.170050000 +0900 @@ -405,10 +405,10 @@ (let ((to (gnus-group-guess-full-name-from-command-method group)) (recipients (or recipients (gnus-registry-sort-addresses - (or (message-fetch-field "cc") "") - (or (message-fetch-field "to") "")))) - (subject (or subject (message-fetch-field "subject"))) - (sender (or sender (message-fetch-field "from")))) + (or (message-field-value "cc") "") + (or (message-field-value "to") "")))) + (subject (or subject (message-field-value "subject"))) + (sender (or sender (message-field-value "from")))) (when (and (stringp id) (string-match "\r$" id)) (setq id (substring id 0 -1))) (gnus-message 7 "Gnus registry: article %s spooled to %s" Diff finished. Wed Jun 24 11:13:17 2020 Gnus v5.13 GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2020-04-04