From d889a620a01f72a02bc6c098a0c9269cdaadb9cc Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 19 Apr 2011 19:50:55 +0000 Subject: [PATCH] Fix Crash * check pointer before accessing it * fix probably uninitialized case --- citadel/modules/smtp/serv_smtpeventclient.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/citadel/modules/smtp/serv_smtpeventclient.c b/citadel/modules/smtp/serv_smtpeventclient.c index a2913bb9b..85ef2813b 100644 --- a/citadel/modules/smtp/serv_smtpeventclient.c +++ b/citadel/modules/smtp/serv_smtpeventclient.c @@ -170,8 +170,9 @@ eNextState FailOneAttempt(AsyncIO *IO) * possible ways here: * - connection timeout * - - */ - SendMsg->pCurrRelay = SendMsg->pCurrRelay->Next; + */ + if (SendMsg->pCurrRelay != NULL) + SendMsg->pCurrRelay = SendMsg->pCurrRelay->Next; if (SendMsg->pCurrRelay == NULL) return eAbort; @@ -494,8 +495,10 @@ void smtp_try_one_queue_entry(OneQueItem *MyQItem, void SMTPSetTimeout(eNextState NextTCPState, SmtpOutMsg *pMsg) { + double Timeout = 0.0; + CtdlLogPrintf(CTDL_DEBUG, "SMTP: %s\n", __FUNCTION__); - double Timeout; + switch (NextTCPState) { case eSendReply: case eSendMore: -- 2.30.2