mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Fix redis-cli rare crash.
This happens if the server (mysteriously) returns an unexpected response to the COMMAND command.
This commit is contained in:
parent
978a790b85
commit
b6ab4d04b6
@ -275,6 +275,10 @@ static void cliIntegrateHelp(void) {
|
||||
* don't already match what we have. */
|
||||
for (size_t j = 0; j < reply->elements; j++) {
|
||||
redisReply *entry = reply->element[j];
|
||||
if (entry->type != REDIS_REPLY_ARRAY || entry->elements < 4 ||
|
||||
entry->element[0]->type != REDIS_REPLY_STRING ||
|
||||
entry->element[1]->type != REDIS_REPLY_INTEGER ||
|
||||
entry->element[3]->type != REDIS_REPLY_INTEGER) return;
|
||||
char *cmdname = entry->element[0]->str;
|
||||
int i;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user