diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2012-10-09 00:58:56 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2012-10-09 00:58:56 +0400 |
commit | 20f555eafb8da3cf11d9365a1e3aeadd0a905b5e (patch) | |
tree | 90fd7b06619d20505cb1fc0315c8bb9d3f3c6e96 | |
parent | 7dfac44c8fab2be6e5bf190e7e0cf9221669a1de (diff) |
Copy zval in multi/exec/pipe forwarded array calls
* Addresses GitHub issue #262
* Tested successfully with code provided by bug reporter
* array-tests.php passes
-rw-r--r-- | redis_array.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/redis_array.c b/redis_array.c index 380c53c1..d0460f10 100644 --- a/redis_array.c +++ b/redis_array.c @@ -700,7 +700,12 @@ PHP_METHOD(RedisArray, setOption) /* copy all args into a zval hash table */\ array_init(&z_arg_array);\ for(i = 0; i < num_varargs; ++i) {\ - add_next_index_zval(&z_arg_array, *varargs[i]);\ + zval *z_tmp;\ + MAKE_STD_ZVAL(z_tmp);\ + *z_tmp = **varargs[i];\ + zval_copy_ctor(z_tmp);\ + INIT_PZVAL(z_tmp);\ + add_next_index_zval(&z_arg_array, z_tmp);\ }\ /* call */\ ra_forward_call(INTERNAL_FUNCTION_PARAM_PASSTHRU, ra, cmd, sizeof(cmd)-1, &z_arg_array, NULL);\ |