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 fdd66d7ae6c17a1d47d066e5121c87b587c5cee3..68995ddf7153401a26f8aa7222285959b33f16ca 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 10e71dcfb5ce759821ac37ed9a69a73f48d33344..d15613d4907d591f0b5fa98d376b9bcbb0533e92 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 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;