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

Skip to content

Commit c0dbf8c

Browse files
committed
Fix Github issue phpredis#4
1 parent 0987d08 commit c0dbf8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

redis.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4820,6 +4820,9 @@ PHP_METHOD(Redis, subscribe)
48204820
/* read the status of the execution of the command `subscribe` */
48214821

48224822
z_tab = redis_sock_read_multibulk_reply_zval(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock);
4823+
if(z_tab == NULL) {
4824+
RETURN_FALSE;
4825+
}
48234826

48244827
if (zend_hash_index_find(Z_ARRVAL_P(z_tab), 0, (void**)&tmp) == SUCCESS) {
48254828
type_response = Z_STRVAL_PP(tmp);
@@ -4865,7 +4868,7 @@ PHP_METHOD(Redis, subscribe)
48654868
zval **type, **channel, **data;
48664869
z_tab = redis_sock_read_multibulk_reply_zval(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock);
48674870

4868-
if(Z_TYPE_P(z_tab) != IS_ARRAY) {
4871+
if(z_tab == NULL || Z_TYPE_P(z_tab) != IS_ARRAY) {
48694872
//ERROR
48704873
break;
48714874
}

0 commit comments

Comments
 (0)