Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-10-13 23:05:20 +0300
committerGitHub <noreply@github.com>2020-10-13 23:05:20 +0300
commit514bc37102c08c1ba7222212b125390f34c35803 (patch)
tree3a5748c71d2e419cc8521f7b5a45f22881a70a22 /redis_commands.c
parent44345f0afb5e7820410e4ccb95f9bd10b7b8cb1b (diff)
Verify SET options are strings before testing them as strings. (#1859)
Addresses #1835
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 07f409c7..aa89b7c2 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -1370,10 +1370,12 @@ int redis_set_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
} else if (Z_TYPE_P(v) == IS_STRING) {
expire = atol(Z_STRVAL_P(v));
}
- } else if (ZVAL_STRICMP_STATIC(v, "KEEPTTL")) {
- keep_ttl = 1;
- } else if (ZVAL_IS_NX_XX_ARG(v)) {
- set_type = Z_STRVAL_P(v);
+ } else if (Z_TYPE_P(v) == IS_STRING) {
+ if (ZVAL_STRICMP_STATIC(v, "KEEPTTL")) {
+ keep_ttl = 1;
+ } else if (ZVAL_IS_NX_XX_ARG(v)) {
+ set_type = Z_STRVAL_P(v);
+ }
}
} ZEND_HASH_FOREACH_END();
} else if (z_opts && Z_TYPE_P(z_opts) != IS_NULL) {