EV: fix possible nullpointer access in last commit.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 12 May 2013 20:44:11 +0000 (22:44 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 12 May 2013 20:44:11 +0000 (22:44 +0200)
citadel/event_client.c
citadel/modules/rssclient/serv_rssclient.c
citadel/modules/smtp/serv_smtpeventclient.c

index fdd66d7..68995dd 100644 (file)
@@ -101,7 +101,8 @@ void SetEVState(AsyncIO *IO, eIOState State)
 {
 
        CitContext* CCC = IO->CitContext;
-       memcpy(CCC->lastcmdname, IOStates[State].Key, IOStates[State].len + 1);
+       if (CCC != NULL)
+               memcpy(CCC->lastcmdname, IOStates[State].Key, IOStates[State].len + 1);
 
 }
 
index 10e71dc..d15613d 100644 (file)
@@ -111,7 +111,8 @@ ConstStr RSSStates[] = {
 static void SetRSSState(AsyncIO *IO, RSSState State)
 {
        CitContext* CCC = IO->CitContext;
-       memcpy(CCC->cs_clientname, RSSStates[State].Key, RSSStates[State].len + 1);
+       if (CCC != NULL)
+               memcpy(CCC->cs_clientname, RSSStates[State].Key, RSSStates[State].len + 1);
 }
 
 void DeleteRoomReference(long QRnumber)
index b3ec5da..dd4e3e2 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;