File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -670,17 +670,26 @@ PS_READ_FUNC(rediscluster) {
670670
671671 /* Attempt to read reply */
672672 reply = cluster_read_resp (c TSRMLS_CC );
673- if (!reply || c -> err || reply -> str == NULL ) {
673+ if (!reply || c -> err ) {
674674 if (reply ) cluster_free_reply (reply , 1 );
675675 return FAILURE ;
676676 }
677677
678678 /* Push reply value to caller */
679679#if (PHP_MAJOR_VERSION < 7 )
680- * val = reply -> str ;
681- * vallen = reply -> len ;
680+ if (reply -> str == NULL ) {
681+ * val = STR_EMPTY_ALLOC ();
682+ * vallen = 0 ;
683+ } else {
684+ * val = reply -> str ;
685+ * vallen = reply -> len ;
686+ }
682687#else
683- * val = zend_string_init (reply -> str , reply -> len , 0 );
688+ if (reply -> str == NULL ) {
689+ * val = ZSTR_EMPTY_ALLOC ();
690+ } else {
691+ * val = zend_string_init (reply -> str , reply -> len , 0 );
692+ }
684693#endif
685694
686695 /* Clean up */
You can’t perform that action at this time.
0 commit comments