]> granicus.if.org Git - php/commitdiff
Restrict this function to a max of 65k io vectors to avoid weird
authorRasmus Lerdorf <rasmus@php.net>
Tue, 25 Mar 2003 15:54:26 +0000 (15:54 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Tue, 25 Mar 2003 15:54:26 +0000 (15:54 +0000)
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.

ext/sockets/sockets.c

index f09f7a988586247fb5bd8105711e4c0f7bdfa96e..8213f44ee47aa17fdace260dc30c90ca4e959dce 100644 (file)
@@ -1095,7 +1095,12 @@ PHP_FUNCTION(socket_iovec_alloc)
        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**));