diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2017-08-28 16:14:42 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2017-08-28 16:17:05 +0300 |
commit | 4a0a46b4cba01e870638abf095a47cb429e9c756 (patch) | |
tree | 98a423aac0ae4b658c2b0714534782e339019b5b /redis_array_impl.c | |
parent | e5660be4c62d8afbae1fd2305e674f7711926098 (diff) |
Check number of elements in incoming array-argument
Diffstat (limited to 'redis_array_impl.c')
-rw-r--r-- | redis_array_impl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/redis_array_impl.c b/redis_array_impl.c index 902831c2..0d740a0f 100644 --- a/redis_array_impl.c +++ b/redis_array_impl.c @@ -344,8 +344,7 @@ ra_make_array(HashTable *hosts, zval *z_fun, zval *z_dist, HashTable *hosts_prev int i, count; RedisArray *ra; - if (!hosts) return NULL; - count = zend_hash_num_elements(hosts); + if (!hosts || (count = zend_hash_num_elements(hosts)) == 0) return NULL; /* create object */ ra = emalloc(sizeof(RedisArray)); |