Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a7952d

Browse files
If no valid keys are found when processing an HMGET command,
free up our command and keys pointer and simply return FALSE. Addresses phpredis#379
1 parent 8ed1a29 commit 1a7952d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

redis.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4993,6 +4993,13 @@ PHP_METHOD(Redis, hMget) {
49934993
}
49944994
}
49954995

4996+
// This is a failure if none of the keys were valid
4997+
if(i == 0) {
4998+
efree(cmd);
4999+
efree(z_keys);
5000+
RETURN_FALSE;
5001+
}
5002+
49965003
REDIS_PROCESS_REQUEST(redis_sock, cmd, cmd_len);
49975004
IF_ATOMIC() {
49985005
redis_sock_read_multibulk_reply_assoc(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, z_keys);

0 commit comments

Comments
 (0)