From: Didier Verna Date: Sat, 16 Feb 2013 02:45:24 +0000 (-0800) Subject: * lisp/net/network-stream.el (network-stream-open-starttls): X-Git-Tag: emacs-24.3-rc1~48 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e5b246e9f36efcf667809b22538af3c33fe6d99a;p=emacs.git * lisp/net/network-stream.el (network-stream-open-starttls): Check that response to the starttls-command is non-nil. Fixes: debbugs:13706 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a328a749bc..735ddd25369 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-02-16 Didier Verna + + * net/network-stream.el (network-stream-open-starttls): + Check that response to the starttls-command is non-nil. (Bug#13706) + 2013-02-14 Glenn Morris * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 8cf9ec67e53..fd21997ba28 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)))