Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7805da7

Browse filesBrowse files
yatsukhnenkomichael-grunder
authored andcommitted
Fix HSetEx expiry argument handling
1 parent 2acab39 commit 7805da7
Copy full SHA for 7805da7

1 file changed

+7-7Lines changed: 7 additions & 7 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎redis_commands.c‎

Copy file name to clipboardExpand all lines: redis_commands.c
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4842,7 +4842,7 @@ typedef struct redisHSetExOptions {
48424842
zend_long exp_arg;
48434843
} redisHSetExOptions;
48444844

4845-
void get_hsetex_expiry_options(redisHSetExOptions *dst, zval *zsrc) {
4845+
void get_hsetex_expiry_options(redisHSetExOptions *dst, HashTable *src) {
48464846
zend_string *key;
48474847
zend_long lval;
48484848
zval *zv;
@@ -4851,10 +4851,10 @@ void get_hsetex_expiry_options(redisHSetExOptions *dst, zval *zsrc) {
48514851
.exp_arg = -1,
48524852
};
48534853

4854-
if (zsrc == NULL)
4854+
if (src == NULL)
48554855
return;
48564856

4857-
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zsrc), key, zv) {
4857+
ZEND_HASH_FOREACH_STR_KEY_VAL(src, key, zv) {
48584858
if (key == NULL) {
48594859
if (Z_TYPE_P(zv) == IS_STRING) {
48604860
key = Z_STR_P(zv);
@@ -4887,26 +4887,26 @@ int redis_hsetex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
48874887
char **cmd, int *cmd_len, short *slot, void **ctx)
48884888
{
48894889
redisHSetExOptions opts = {0};
4890-
zval *zexpiry = NULL, *zv;
48914890
smart_string cmdstr = {0};
4892-
HashTable *fields;
4891+
HashTable *fields, *expiry = NULL;
48934892
zend_string *key;
48944893
zend_ulong idx;
4894+
zval *zv;
48954895
int argc;
48964896

48974897
ZEND_PARSE_PARAMETERS_START(2, 3)
48984898
Z_PARAM_STR(key)
48994899
Z_PARAM_ARRAY_HT(fields)
49004900
Z_PARAM_OPTIONAL
4901-
Z_PARAM_ZVAL_OR_NULL(zexpiry);
4901+
Z_PARAM_ARRAY_HT_OR_NULL(expiry);
49024902
ZEND_PARSE_PARAMETERS_END_EX(return FAILURE);
49034903

49044904
if (zend_hash_num_elements(fields) == 0) {
49054905
php_error_docref(NULL, E_WARNING, "Must pass at least one field");
49064906
return FAILURE;
49074907
}
49084908

4909-
get_hsetex_expiry_options(&opts, zexpiry);
4909+
get_hsetex_expiry_options(&opts, expiry);
49104910

49114911
argc = 3 + !!opts.set_mode + !!opts.exp_type + (opts.exp_arg >= 0) +
49124912
zend_hash_num_elements(fields) * 2;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.