From: Rasmus Lerdorf Date: Tue, 25 Mar 2003 15:54:26 +0000 (+0000) Subject: Restrict this function to a max of 65k io vectors to avoid weird X-Git-Tag: php-4.3.2RC2~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f461ad12fba175b705923981a48d8a41278783a3;p=php 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. --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index f09f7a9885..8213f44ee4 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -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**));