File: 036-fd_setsize_fix.patch

package info (click to toggle)
php5 5.2.0-8%2Betch1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 58,836 kB
  • ctags: 45,575
  • sloc: ansic: 535,107; sh: 17,819; php: 11,336; cpp: 4,289; xml: 3,861; yacc: 2,446; lex: 2,174; makefile: 1,150; tcl: 1,128; awk: 693; perl: 71; sql: 22; pascal: 15
file content (24 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff -urN php-5.0.4.orig/ext/sockets/sockets.c php-5.0.4/ext/sockets/sockets.c
--- php-5.0.4.orig/ext/sockets/sockets.c	2005-02-15 00:44:31.000000000 +0100
+++ php-5.0.4/ext/sockets/sockets.c	2005-04-10 17:32:15.851738072 +0200
@@ -542,6 +542,7 @@
 
 		php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
 		if (!php_sock) continue; /* If element is not a resource, skip it */
+		if (php_sock->bsd_socket > FD_SETSIZE) continue; /* must ignore it */
 
 		PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
 		if (php_sock->bsd_socket > *max_fd) {
diff -urN php-5.0.4.orig/ext/standard/streamsfuncs.c php-5.0.4/ext/standard/streamsfuncs.c
--- php-5.0.4.orig/ext/standard/streamsfuncs.c	2005-01-15 05:51:03.000000000 +0100
+++ php-5.0.4/ext/standard/streamsfuncs.c	2005-04-10 17:34:29.274454736 +0200
@@ -588,6 +588,9 @@
 		 * is not displayed.
 		 * */
 		if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) {
+			if (this_fd > FD_SETSIZE)
+				continue;
+
 			
 			PHP_SAFE_FD_SET(this_fd, fds);