Fix Crash
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 19 Apr 2011 19:50:55 +0000 (19:50 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 19 Apr 2011 19:50:55 +0000 (19:50 +0000)
  * check pointer before accessing it
  * fix probably uninitialized case

citadel/modules/smtp/serv_smtpeventclient.c

index a2913bb9b23d57a2024c16f1c970c5572170cf95..85ef2813bcec4144077031c14594c8c7c723bb90 100644 (file)
@@ -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: