summaryrefslogtreecommitdiff
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
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.
-rw-r--r--imap/src/c-client/nntp.c8
-rw-r--r--pith/pine.hlp2
2 files changed, 8 insertions, 2 deletions
diff --git a/imap/src/c-client/nntp.c b/imap/src/c-client/nntp.c
index 53b5145..67a5d42 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;
}
diff --git a/pith/pine.hlp b/pith/pine.hlp
index fd10697..35e4039 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 356 2019-07-05 19:50:09
+Alpine Commit 359 2019-07-11 22:43:59
============= h_news =================
<HTML>
<HEAD>