summaryrefslogtreecommitdiff
path: root/imap
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-07-11 22:44:06 -0600
committerEduardo Chappa <chappa@washington.edu>2019-07-11 22:44:06 -0600
commit444474440a73e5710dde73d87d2587bdbcc68f52 (patch)
treed65c9e10a449848503783d7901b7a23852228cb3 /imap
parent39a1ab075bb04475114ada78146e9cb35b17e63b (diff)
downloadalpine-444474440a73e5710dde73d87d2587bdbcc68f52.tar.xz
* Alpine crashes when trying to post an article in a newsgroup and the
connection is closed while the post is being composed, but later the post is attempted to be sent. In some instances, the stream may be open and closed during this time, but Alpine does not realize the connection was closed and attempts the post without a netstream, producing a crash.
Diffstat (limited to 'imap')
-rw-r--r--imap/src/c-client/nntp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/imap/src/c-client/nntp.c b/imap/src/c-client/nntp.c
index 53b51454..67a5d422 100644
--- a/imap/src/c-client/nntp.c
+++ b/imap/src/c-client/nntp.c
@@ -1,5 +1,6 @@
/* ========================================================================
* Copyright 2008-2011 Mark Crispin
+ * Copyright 2019 Eduardo Chappa
* ========================================================================
*/
@@ -9,7 +10,7 @@
* Author: Mark Crispin
*
* Date: 10 February 1992
- * Last Edited: 8 April 2011
+ * Last Edited: July 10, 2019.
*
* Previous versions of this file were:
*
@@ -1806,6 +1807,11 @@ SENDSTREAM *nntp_open_full (NETDRIVER *dv,char **hostlist,char *service,
else if (extok) nntp_extensions (stream,(mb.secflag ? AU_SECURE : NIL) |
(mb.authuser[0] ? AU_AUTHUSER : NIL));
}
+ /* check one last time that we have a netstream before returning
+ * a stream that does not have it. Otherwise, nntp_mail will fail
+ * trying to dereference a null pointer.
+ */
+ if(stream && !stream->netstream) stream = nntp_close(stream);
return stream;
}