aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-12-07 02:54:02 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-12-07 02:54:02 +0000
commit817bc7979baab872631863d477f538a3eeba1aa7 (patch)
treec0d6a87caf193dbc79a3552be594e7661d0d13f2 /sink.c
parentce8a1c68e56a8237b597c85c2f1dd9bd0c6db188 (diff)
downloadfetchmail-817bc7979baab872631863d477f538a3eeba1aa7.tar.gz
fetchmail-817bc7979baab872631863d477f538a3eeba1aa7.tar.bz2
fetchmail-817bc7979baab872631863d477f538a3eeba1aa7.zip
Fix Ken Estes's core-dump bug.
svn path=/trunk/; revision=2262
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sink.c b/sink.c
index c603b8a6..3d012811 100644
--- a/sink.c
+++ b/sink.c
@@ -40,6 +40,9 @@
#define SIGCHLD SIGCLD
#endif
+/* makes the open_sink()/close_sink() pair non-reentrant */
+static lmtp_responses;
+
static int smtp_open(struct query *ctl)
/* try to open a socket to the appropriate SMTP server for this query */
{
@@ -714,7 +717,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
* We need to stash this away in order to know how many
* response lines to expect after the LMTP end-of-message.
*/
- msg->lmtp_responses = *good_addresses;
+ lmtp_responses = *good_addresses;
return(PS_SUCCESS);
}
@@ -789,7 +792,7 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward)
* to people who got it the first time.
*/
if (ctl->listener == LMTP_MODE)
- if (msg->lmtp_responses == 0)
+ if (lmtp_responses == 0)
{
SMTP_ok(ctl->smtp_socket);
@@ -821,8 +824,8 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward)
char **responses;
/* eat the RFC2033-required responses, saving errors */
- xalloca(responses, char **, sizeof(char *) * msg->lmtp_responses);
- for (errors = i = 0; i < msg->lmtp_responses; i++)
+ xalloca(responses, char **, sizeof(char *) * lmtp_responses);
+ for (errors = i = 0; i < lmtp_responses; i++)
{
if (SMTP_ok(ctl->smtp_socket) == SM_OK)
responses[i] = (char *)NULL;