* bug#13706: 24.3.50; network-stream-command may return nil, not always a string
@ 2013-02-13 9:54 Didier Verna
2013-02-16 2:45 ` Glenn Morris
0 siblings, 1 reply; 2+ messages in thread
From: Didier Verna @ 2013-02-13 9:54 UTC (permalink / raw)
To: 13706; +Cc: Lars Magne Ingebrigtsen
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
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 <didier@didierverna.net>
* net/network-stream.el (network-stream-open-starttls): Check that
the response to the starttls-command is not nil before
string-match'ing it.
[-- Attachment #2: diff.patch --]
[-- Type: text/plain, Size: 815 bytes --]
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)))
[-- Attachment #3: Type: text/plain, Size: 287 bytes --]
--
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#13706: 24.3.50; network-stream-command may return nil, not always a string
2013-02-13 9:54 bug#13706: 24.3.50; network-stream-command may return nil, not always a string Didier Verna
@ 2013-02-16 2:45 ` Glenn Morris
0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2013-02-16 2:45 UTC (permalink / raw)
To: 13706-done
Version: 24.3
Thanks; applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-16 2:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13 9:54 bug#13706: 24.3.50; network-stream-command may return nil, not always a string Didier Verna
2013-02-16 2:45 ` Glenn Morris
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).