GNU bug report logs - #13706
24.3.50; network-stream-command may return nil, not always a string

Previous Next

Package: emacs;

Reported by: Didier Verna <didier <at> didierverna.net>

Date: Wed, 13 Feb 2013 10:33:01 UTC

Severity: normal

Found in version 24.3.50

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13706 in the body.
You can then email your comments to 13706 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13706; Package emacs. (Wed, 13 Feb 2013 10:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Didier Verna <didier <at> didierverna.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 13 Feb 2013 10:33:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Didier Verna <didier <at> didierverna.net>
To: bug-gnu-emacs <at> gnu.org
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: 24.3.50; network-stream-command may return nil, not always a string
Date: Wed, 13 Feb 2013 10:54:27 +0100
[Message part 1 (text/plain, inline)]
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 <at> 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.


[diff.patch (text/plain, inline)]
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)))
[Message part 3 (text/plain, inline)]

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

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 16 Feb 2013 02:47:02 GMT) Full text and rfc822 format available.

Notification sent to Didier Verna <didier <at> didierverna.net>:
bug acknowledged by developer. (Sat, 16 Feb 2013 02:47:02 GMT) Full text and rfc822 format available.

Message #10 received at 13706-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 13706-done <at> debbugs.gnu.org
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
Version: 24.3

Thanks; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Mar 2013 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.