php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65285
Patch conversions-socket_sendmsg.patch revision 2013-07-18 08:21 UTC by bugs dot php dot net at ss dot chernousov dot net

Patch conversions-socket_sendmsg.patch for Sockets related Bug #65285

Patch version 2013-07-18 08:21 UTC

Return to Bug #65285 | Download this patch
Patch Revisions:

Developer: bugs.php.net@ss.chernousov.net

diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c
index ed55ed5..b4f1725 100644
--- a/ext/sockets/conversions.c
+++ b/ext/sockets/conversions.c
@@ -1379,7 +1379,8 @@ static void from_zval_write_fd_array_aux(zval **elem, unsigned i, void **args, s
 	int *iarr = args[0];
 	TSRMLS_FETCH();
 
-	if (Z_TYPE_PP(elem) == IS_RESOURCE) {
+	switch (Z_TYPE_PP(elem)) {
+	case IS_RESOURCE: {
 		php_stream *stream;
 		php_socket *sock;
 
@@ -1402,8 +1403,17 @@ static void from_zval_write_fd_array_aux(zval **elem, unsigned i, void **args, s
 			do_from_zval_err(ctx, "cast stream to file descriptor failed");
 			return;
 		}
-	} else {
+		break;
+	}
+
+	case IS_LONG: {
+		iarr[i - 1] = Z_LVAL_PP(elem);
+		break;
+	}
+
+	default:
 		do_from_zval_err(ctx, "expected a resource variable");
+		break;
 	}
 }
 void from_zval_write_fd_array(const zval *arr, char *int_arr, ser_context *ctx)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC