From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Didier Verna Newsgroups: gmane.emacs.bugs Subject: bug#13706: 24.3.50; network-stream-command may return nil, not always a string Date: Wed, 13 Feb 2013 10:54:27 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1360751562 13839 80.91.229.3 (13 Feb 2013 10:32:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Feb 2013 10:32:42 +0000 (UTC) Cc: Lars Magne Ingebrigtsen To: 13706@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 13 11:33:03 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U5Ze3-0003Gl-Uo for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Feb 2013 11:32:56 +0100 Original-Received: from localhost ([::1]:52426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Zdk-0003mD-I8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Feb 2013 05:32:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Zdh-0003lw-6z for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:32:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5Zdf-0002sV-HM for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:32:33 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Zdf-0002sR-E4 for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:32:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U5Ze9-00038N-Od for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2013 05:33:01 -0500 X-Loop: help-debbugs@gnu.org 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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136075152211971 (code B ref -1); Wed, 13 Feb 2013 10:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Feb 2013 10:32:02 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id E15C716E1475; Wed, 13 Feb 2013 10:54:34 +0100 (CET) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71169 Archived-At: --=-=-= 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 --=-=-=--