From unknown Sat Sep 20 01:11:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13706: 24.3.50; network-stream-command may return nil, not always a string Resent-From: Didier Verna Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Feb 2013 10:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13706 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13706@debbugs.gnu.org Cc: Lars Magne Ingebrigtsen X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136075152211971 (code B ref -1); Wed, 13 Feb 2013 10:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Feb 2013 10:32:02 +0000 Received: from localhost ([127.0.0.1]:53313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5ZdA-00036t-LY for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:32:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56541) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5Zd8-00036l-7p for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5ZcV-0002Og-9m for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, USER_IN_WHITELIST autolearn=no version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcV-0002OP-7A for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcR-00038H-7I for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5ZcL-0002Ma-VK for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:15 -0500 Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:47768 helo=uzeb.lrde.epita.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcL-0002MU-Oy for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:09 -0500 Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id E15C716E1475; Wed, 13 Feb 2013 10:54:34 +0100 (CET) From: Didier Verna X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUOCgORcVvp6egrJBnO vrL09vDw8OxfSTYGmHLRAAACRklEQVQ4jWWSQWvjMBCFJ2jB11ViqnNFpLO8Cvjs4DZ3EeUHCOyz vSrM398nu7Hb7ZhAeJ9m3sxINI5DHBERMa4Rh2QfVP58BUOEah+3AoavQNsYTLg5Gv+LIepY9B/g oWO6OSd+gGSCIvEzIxbdC/8dPADuykMVOxjCYGx4hBO1qEN7V3oIehjuqIOP8NuKn69xOJ9gWwyo 2kCSMpxPJCZaetrbvUvZK7fWyd/BKZfjHlpFfjcPKjvvBbc4Xjm/Z5w96lStlLIMLhqyo01GR+gt isyyEE+NJV0GiGd2KCBKQt/J3817JBuTjq/OT4JcxXW/kLfBUsTN9Fk4ePpK9lBlL40JlGzsJqwH bXKjVpKPgyETu4y2ReUaWat2Bsn0kgyFzvtlXneQda9azO+rawzUTQJ9unbKAqd7yVK5y6AD+SzK Rj8UfEodxdxoBJbsaCKB+tOhg7fi/KtsYgFw4E5yLYsLT39WgEIVufajk3Wt5gKOC1gmAGvKALBm dtfFw5UXkcHmXqoa1izsAjCDw2Kd8GWxJeFgNgAfN9/aFdDfFeBSWtDZ3nO5DJXXhDIHPujmlVkh w13C6iHYCde8j3c1M8+MBYY1Ay+ADleduixn9JQPbzp8mlN7TbqTp1kCuI9kV0C+vcazKioysntP afVwON9DL4B5aqxO4wKqGptedJkBLto8Pdi3jAEKyyxe9GcAMC/LkJ89PcGmLz1dwhcgN+DFMe3g qUvGkzVmA/OWgCdehx1s57Ofe7tV2gCMmzfI4xP8A/Zs/Vdhx7k5AAAAAElFTkSuQmCC X-Face: 8K/O!t_qi|N?csgS`Cl&qMeQcrKrfOHLQl0-7j\2#Hin#, OG-$AP9dhJF'PD}P}$=-/9\(B \X|4g&RiV9 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain network-stream-get-response returns nil if the server connection is lost, hence network-stream-command does the same. There was one instance of a blind string-match against the return value which would fail with a STRINGP NIL error from time to time. The attached patch fixes this. 2013-02-13 Didier Verna * net/network-stream.el (network-stream-open-starttls): Check that the response to the starttls-command is not nil before string-match'ing it. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=diff.patch diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 8cf9ec6..fd21997 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -262,8 +262,9 @@ STARTTLS upgrades even if Emacs doesn't have built-in TLS functionality. ;; EHLO for SMTP. (when (plist-get parameters :always-query-capabilities) (network-stream-command stream capability-command eo-capa))) - (when (string-match success-string - (network-stream-command stream starttls-command eoc)) + (when (let ((response + (network-stream-command stream starttls-command eoc))) + (and response (string-match success-string response))) ;; The server said it was OK to begin STARTTLS negotiations. (if builtin-starttls (let ((cert (network-stream-certificate host service parameters))) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable --=20 Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com EPITA/LRDE, 14-16 rue Voltaire, 94276 Le Kremlin-Bic=AAtre, France Tel. +33 (0)1 44 08 01 85 Fax. +33 (0)1 53 14 59 22 --=-=-=-- From unknown Sat Sep 20 01:11:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Didier Verna Subject: bug#13706: closed (Re: bug#13706: 24.3.50; network-stream-command may return nil, not always a string) Message-ID: References: <1my5epkmcm.fsf@fencepost.gnu.org> X-Gnu-PR-Message: they-closed 13706 X-Gnu-PR-Package: emacs Reply-To: 13706@debbugs.gnu.org Date: Sat, 16 Feb 2013 02:47:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1360982822-29925-1" This is a multi-part message in MIME format... ------------=_1360982822-29925-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13706: 24.3.50; network-stream-command may return nil, not always a string which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13706@debbugs.gnu.org. --=20 13706: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13706 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1360982822-29925-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13706-done) by debbugs.gnu.org; 16 Feb 2013 02:46:34 +0000 Received: from localhost ([127.0.0.1]:58390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U6XnO-0007lx-2Z for submit@debbugs.gnu.org; Fri, 15 Feb 2013 21:46:34 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:37744) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U6XnM-0007lq-7T for 13706-done@debbugs.gnu.org; Fri, 15 Feb 2013 21:46:32 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U6Xmb-0006Qe-LX; Fri, 15 Feb 2013 21:45:45 -0500 From: Glenn Morris To: 13706-done@debbugs.gnu.org Subject: Re: bug#13706: 24.3.50; network-stream-command may return nil, not always a string References: X-Spook: SEAL Team 6 underground weapons of mass destruction Etacs X-Ran: bo0t_t.L&jv(e1K]JaL8cg,n5.EG%.Y]:^vq$MoAu0cF/8@l6AChmVRaEbIp]B~Y\D/FDY X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 15 Feb 2013 21:45:45 -0500 In-Reply-To: (Didier Verna's message of "Wed, 13 Feb 2013 10:54:27 +0100") Message-ID: <1my5epkmcm.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13706-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) Version: 24.3 Thanks; applied. ------------=_1360982822-29925-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Feb 2013 10:32:02 +0000 Received: from localhost ([127.0.0.1]:53313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5ZdA-00036t-LY for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:32:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56541) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5Zd8-00036l-7p for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5ZcV-0002Og-9m for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, USER_IN_WHITELIST autolearn=no version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcV-0002OP-7A for submit@debbugs.gnu.org; Wed, 13 Feb 2013 05:31:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcR-00038H-7I for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5ZcL-0002Ma-VK for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:15 -0500 Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:47768 helo=uzeb.lrde.epita.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5ZcL-0002MU-Oy for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:31:09 -0500 Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id E15C716E1475; Wed, 13 Feb 2013 10:54:34 +0100 (CET) From: Didier Verna To: bug-gnu-emacs@gnu.org Subject: 24.3.50; network-stream-command may return nil, not always a string X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUOCgORcVvp6egrJBnO vrL09vDw8OxfSTYGmHLRAAACRklEQVQ4jWWSQWvjMBCFJ2jB11ViqnNFpLO8Cvjs4DZ3EeUHCOyz vSrM398nu7Hb7ZhAeJ9m3sxINI5DHBERMa4Rh2QfVP58BUOEah+3AoavQNsYTLg5Gv+LIepY9B/g oWO6OSd+gGSCIvEzIxbdC/8dPADuykMVOxjCYGx4hBO1qEN7V3oIehjuqIOP8NuKn69xOJ9gWwyo 2kCSMpxPJCZaetrbvUvZK7fWyd/BKZfjHlpFfjcPKjvvBbc4Xjm/Z5w96lStlLIMLhqyo01GR+gt isyyEE+NJV0GiGd2KCBKQt/J3817JBuTjq/OT4JcxXW/kLfBUsTN9Fk4ePpK9lBlL40JlGzsJqwH bXKjVpKPgyETu4y2ReUaWat2Bsn0kgyFzvtlXneQda9azO+rawzUTQJ9unbKAqd7yVK5y6AD+SzK Rj8UfEodxdxoBJbsaCKB+tOhg7fi/KtsYgFw4E5yLYsLT39WgEIVufajk3Wt5gKOC1gmAGvKALBm dtfFw5UXkcHmXqoa1izsAjCDw2Kd8GWxJeFgNgAfN9/aFdDfFeBSWtDZ3nO5DJXXhDIHPujmlVkh w13C6iHYCde8j3c1M8+MBYY1Ay+ADleduixn9JQPbzp8mlN7TbqTp1kCuI9kV0C+vcazKioysntP afVwON9DL4B5aqxO4wKqGptedJkBLto8Pdi3jAEKyyxe9GcAMC/LkJ89PcGmLz1dwhcgN+DFMe3g qUvGkzVmA/OWgCdehx1s57Ofe7tV2gCMmzfI4xP8A/Zs/Vdhx7k5AAAAAElFTkSuQmCC X-Face: 8K/O!t_qi|N?csgS`Cl&qMeQcrKrfOHLQl0-7j\2#Hin#, OG-$AP9dhJF'PD}P}$=-/9\(B \X|4g&RiV9 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit Cc: Lars Magne Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain network-stream-get-response returns nil if the server connection is lost, hence network-stream-command does the same. There was one instance of a blind string-match against the return value which would fail with a STRINGP NIL error from time to time. The attached patch fixes this. 2013-02-13 Didier Verna * net/network-stream.el (network-stream-open-starttls): Check that the response to the starttls-command is not nil before string-match'ing it. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=diff.patch diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 8cf9ec6..fd21997 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -262,8 +262,9 @@ STARTTLS upgrades even if Emacs doesn't have built-in TLS functionality. ;; EHLO for SMTP. (when (plist-get parameters :always-query-capabilities) (network-stream-command stream capability-command eo-capa))) - (when (string-match success-string - (network-stream-command stream starttls-command eoc)) + (when (let ((response + (network-stream-command stream starttls-command eoc))) + (and response (string-match success-string response))) ;; The server said it was OK to begin STARTTLS negotiations. (if builtin-starttls (let ((cert (network-stream-certificate host service parameters))) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable --=20 Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com EPITA/LRDE, 14-16 rue Voltaire, 94276 Le Kremlin-Bic=AAtre, France Tel. +33 (0)1 44 08 01 85 Fax. +33 (0)1 53 14 59 22 --=-=-=-- ------------=_1360982822-29925-1--