]> granicus.if.org Git - icinga2/commitdiff
Ensure to check the auth command return value
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 2 Mar 2017 09:18:41 +0000 (10:18 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 14 Mar 2017 13:46:58 +0000 (14:46 +0100)
refs #4991

lib/redis/rediswriter.cpp

index 5d75f5b70e518f168adab703f9b2a2af76e654fe..722d2a3235a2ce9203781b98a21037c750011312 100644 (file)
@@ -67,6 +67,10 @@ void RedisWriter::ConnectionThreadProc(void)
                if (!password.IsEmpty()) {
                        redisReply *reply = reinterpret_cast<redisReply *>(redisCommand(m_Context, "AUTH %s", password.CStr()));
 
+                       //TODO: Verify if we can continue here.
+                       if (!reply)
+                               continue;
+
                        if (reply->type == REDIS_REPLY_STATUS || reply->type == REDIS_REPLY_ERROR) {
                                Log(LogInformation, "RedisWriter")
                                    << "AUTH: " << reply->str;