From 515221e0fcd7333a1db8e74ae4c1fafc1742630d Mon Sep 17 00:00:00 2001 From: Ako Tulu Date: Tue, 29 Oct 2024 14:29:13 +0200 Subject: [PATCH] Fixed issue with ssh2_poll function throwing error when supplied subarray key 'resource' is actually a valid stream. --- ssh2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ssh2.c b/ssh2.c index e6fe36a..7c9e147 100644 --- a/ssh2.c +++ b/ssh2.c @@ -911,8 +911,7 @@ PHP_FUNCTION(ssh2_poll) pollfds[i].events = Z_LVAL_P(tmpzval); hash_key_zstring = zend_string_init("resource", sizeof("resource") - 1, 0); - if ((tmpzval = zend_hash_find(Z_ARRVAL_P(subarray), hash_key_zstring)) == NULL || Z_TYPE_P(tmpzval) != IS_REFERENCE - || (tmpzval = Z_REFVAL_P(tmpzval)) == NULL || Z_TYPE_P(tmpzval) != IS_RESOURCE) { + if ((tmpzval = zend_hash_find(Z_ARRVAL_P(subarray), hash_key_zstring)) == NULL || Z_TYPE_P(tmpzval) != IS_RESOURCE) { php_error_docref(NULL, E_WARNING, "Invalid data in subarray, no resource element, or not of type resource"); numfds--; zend_string_release(hash_key_zstring);