0xsky / xredis

Redis C++ client, support the data slice storage, support redis cluster, thread-safe,multi-platform,connection pool, read/write separation.
GNU General Public License v3.0
337 stars 153 forks source link

Null deref in xRedisClient::command_status #18

Closed nimeshamin closed 8 years ago

nimeshamin commented 8 years ago

After latest pull after a few months, I'm getting a null deref in bool xRedisClient::command_status(const RedisDBIdx& dbi, const char* cmd, ...).

reply->str is null, which gets hit because CheckReply is returning true.

Reply structure:

nimeshamin commented 8 years ago

I think I see what it is, though, I need to review the previous change to this file a bit more to be sure of the expected behavior for the change. The added check for status should be preceded by a pointer check though, at very least

nimeshamin commented 8 years ago

Fixed