From: Didier Verna <didier@didierverna.net>
To: 13706@debbugs.gnu.org
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>
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 [thread overview]
Message-ID: <muxwquca698.fsf@Uzeb.i-did-not-set--mail-host-address--so-tickle-me> (raw)
[-- 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
next reply other threads:[~2013-02-13 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 9:54 Didier Verna [this message]
2013-02-16 2:45 ` bug#13706: 24.3.50; network-stream-command may return nil, not always a string Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=muxwquca698.fsf@Uzeb.i-did-not-set--mail-host-address--so-tickle-me \
--to=didier@didierverna.net \
--cc=13706@debbugs.gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.