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

Skip to content

Commit 42f1c97

Browse files
committed
Fix static analyzer warnings
1 parent 658ee37 commit 42f1c97

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

common.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ typedef struct {
4040
) { \
4141
zend_string _zstr = {0}; \
4242
char *_str_index; uint _str_length; ulong _num_index; \
43-
_val = zend_hash_get_current_data_ex(ht, &_hpos); \
43+
_h = 0; _key = NULL; _val = zend_hash_get_current_data_ex(ht, &_hpos); \
4444
switch (zend_hash_get_current_key_ex(ht, &_str_index, &_str_length, &_num_index, 0, &_hpos)) { \
4545
case HASH_KEY_IS_STRING: \
4646
_zstr.len = _str_length - 1; \
4747
_zstr.val = _str_index; \
4848
_key = &_zstr; \
4949
break; \
5050
case HASH_KEY_IS_LONG: \
51-
_key = NULL; \
5251
_h = _num_index; \
5352
break; \
5453
default: \

redis.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,10 +2774,11 @@ redis_sock_read_multibulk_multi_reply_loop(INTERNAL_FUNCTION_PARAMETERS,
27742774
{
27752775
fold_item *fi;
27762776

2777-
for (fi = redis_sock->head; fi; fi = fi->next) {
2777+
for (fi = redis_sock->head; fi; /* void */) {
27782778
if (fi->fun) {
27792779
fi->fun(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, z_tab,
27802780
fi->ctx TSRMLS_CC);
2781+
fi = fi->next;
27812782
continue;
27822783
}
27832784
size_t len;
@@ -2804,6 +2805,7 @@ redis_sock_read_multibulk_multi_reply_loop(INTERNAL_FUNCTION_PARAMETERS,
28042805
int num = atol(inbuf + 1);
28052806
if (num > 0 && redis_read_multibulk_recursive(redis_sock, num, z_ret TSRMLS_CC) < 0) {
28062807
}
2808+
if (fi) fi = fi->next;
28072809
}
28082810
redis_sock->current = fi;
28092811
return 0;

redis_array.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,11 @@ PHP_METHOD(RedisArray, mset)
10921092
#if (PHP_MAJOR_VERSION < 7)
10931093
MAKE_STD_ZVAL(z_tmp);
10941094
#endif
1095-
ZVAL_ZVAL(z_tmp, argv[i], 1, 0);
1095+
if (argv[i] == NULL) {
1096+
ZVAL_NULL(z_tmp);
1097+
} else {
1098+
ZVAL_ZVAL(z_tmp, argv[i], 1, 0);
1099+
}
10961100
add_assoc_zval_ex(&z_argarray, keys[i], key_lens[i], z_tmp);
10971101
found++;
10981102
}

0 commit comments

Comments
 (0)