mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Merge pull request #3680 from yossigo/fix_rediscli_command_crash
Fix redis-cli rare crash.
This commit is contained in:
commit
39f5c0713e
@ -275,6 +275,10 @@ static void cliIntegrateHelp(void) {
|
|||||||
* don't already match what we have. */
|
* don't already match what we have. */
|
||||||
for (size_t j = 0; j < reply->elements; j++) {
|
for (size_t j = 0; j < reply->elements; j++) {
|
||||||
redisReply *entry = reply->element[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;
|
char *cmdname = entry->element[0]->str;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user