EV: fix possible nullpointer access in last commit.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index b3ec5da0e5ff8bed1a35197d855e7fdc44b8a1ad..dd4e3e2662b08a05a10784a4e36ee4a26dda378f 100644 (file)
@@ -108,7 +108,8 @@ ConstStr SMTPStates[] = {
 void SetSMTPState(AsyncIO *IO, smtpstate State)
 {
        CitContext* CCC = IO->CitContext;
-       memcpy(CCC->cs_clientname, SMTPStates[State].Key, SMTPStates[State].len + 1);
+       if (CCC != NULL)
+               memcpy(CCC->cs_clientname, SMTPStates[State].Key, SMTPStates[State].len + 1);
 }
 
 int SMTPClientDebugEnabled = 0;