emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#13706: closed (24.3.50; network-stream-command may


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13706: closed (24.3.50; network-stream-command may return nil, not always a string)
Date: Sat, 16 Feb 2013 02:47:02 +0000

Your message dated Fri, 15 Feb 2013 21:45:45 -0500
with message-id <address@hidden>
and subject line Re: bug#13706: 24.3.50; network-stream-command may return nil, 
not always a string
has caused the debbugs.gnu.org bug report #13706,
regarding 24.3.50; network-stream-command may return nil, not always a string
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
13706: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13706
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; network-stream-command may return nil, not always a string Date: Wed, 13 Feb 2013 10:54:27 +0100
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  <address@hidden>

        * net/network-stream.el (network-stream-open-starttls): Check that
        the response to the starttls-command is not nil before
        string-match'ing it.


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)))

-- 
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ÂȘtre, France
Tel. +33 (0)1 44 08 01 85       Fax. +33 (0)1 53 14 59 22

--- End Message ---
--- Begin Message --- Subject: Re: bug#13706: 24.3.50; network-stream-command may return nil, not always a string Date: Fri, 15 Feb 2013 21:45:45 -0500 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.3

Thanks; applied.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]