rasmus          Tue Mar 25 10:54:26 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/sockets   sockets.c 
  Log:
  Restrict this function to a max of 65k io vectors to avoid weird
  overflows.  Purely an arbitrary number.  This API needs cleaning up,
  but it would break BC and I don't want to do that in 4.3.
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.125.2.6 php4/ext/sockets/sockets.c:1.125.2.7
--- php4/ext/sockets/sockets.c:1.125.2.6        Mon Mar 24 14:28:58 2003
+++ php4/ext/sockets/sockets.c  Tue Mar 25 10:54:26 2003
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sockets.c,v 1.125.2.6 2003/03/24 19:28:58 rasmus Exp $ */
+/* $Id: sockets.c,v 1.125.2.7 2003/03/25 15:54:26 rasmus Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1095,7 +1095,12 @@
        zval                    ***args = (zval ***)NULL;
        php_iovec_t             *vector;
        struct iovec    *vector_array;
-       int                             i, j, num_vectors, argc = ZEND_NUM_ARGS();
+       long                    num_vectors;
+       int                             i, j, argc = ZEND_NUM_ARGS();
+
+       if(argc>65536) {
+               WRONG_PARAM_COUNT;
+       }
        
        args = emalloc(argc*sizeof(zval**));
 



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

Reply via email to