tony2001                Tue Aug  1 12:04:15 2006 UTC

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/sockets        sockets.c 
  Log:
  re-apply fix for #38251 (socket_select() and invalid arguments)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.146&r2=1.1247.2.920.2.147&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.146 php-src/NEWS:1.1247.2.920.2.147
--- php-src/NEWS:1.1247.2.920.2.146     Tue Aug  1 08:35:06 2006
+++ php-src/NEWS        Tue Aug  1 12:04:14 2006
@@ -3,6 +3,7 @@
 ?? ??? 2006, Version 4.4.4
 - Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's 
   session.cache_expire). (Tony)
+- Fixed bug #38251 (socket_select() and invalid arguments). (Tony)
 - Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
   called Foo). (Jani)
 - Fixed bug #38112 (corrupted gif segfaults) (Pierre)
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.125.2.29.2.5&r2=1.125.2.29.2.6&diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.125.2.29.2.5 
php-src/ext/sockets/sockets.c:1.125.2.29.2.6
--- php-src/ext/sockets/sockets.c:1.125.2.29.2.5        Sun Jul 30 19:15:25 2006
+++ php-src/ext/sockets/sockets.c       Tue Aug  1 12:04:14 2006
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sockets.c,v 1.125.2.29.2.5 2006/07/30 19:15:25 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.125.2.29.2.6 2006/08/01 12:04:14 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -515,6 +515,7 @@
 int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, SOCKET *max_fd 
TSRMLS_DC) {
        zval            **element;
        php_socket      *php_sock;
+       int                     num = 0;
        
        if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
 
@@ -529,9 +530,10 @@
                if (php_sock->bsd_socket > *max_fd) {
                        *max_fd = php_sock->bsd_socket;
                }
+               num++;
        }
 
-       return 1;
+       return num ? 1 : 0;
 }
 
 int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) {
@@ -539,6 +541,7 @@
        zval            **dest_element;
        php_socket      *php_sock;
        HashTable       *new_hash;
+       int                     num = 0;
 
        if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
 
@@ -556,6 +559,7 @@
                        zend_hash_next_index_insert(new_hash, (void *)element, 
sizeof(zval *), (void **)&dest_element);
                        if (dest_element) zval_add_ref(dest_element);
                }
+               num++;
        }
 
        /* Destroy old array, add new one */
@@ -565,7 +569,7 @@
        zend_hash_internal_pointer_reset(new_hash);
        Z_ARRVAL_P(sock_array) = new_hash;
 
-       return 1;
+       return num ? 1 : 0;
 }
 
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to