]> granicus.if.org Git - php/commitdiff
Fix arg list segfault
authorRasmus Lerdorf <rasmus@php.net>
Mon, 24 Mar 2003 19:28:58 +0000 (19:28 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Mon, 24 Mar 2003 19:28:58 +0000 (19:28 +0000)
ext/sockets/sockets.c

index cce87e4d44fa963becb4e07f534c81db914dd529..f09f7a988586247fb5bd8105711e4c0f7bdfa96e 100644 (file)
@@ -1106,7 +1106,11 @@ PHP_FUNCTION(socket_iovec_alloc)
        
        convert_to_long_ex(args[0]);
        num_vectors = Z_LVAL_PP(args[0]);
-       
+
+       if((argc-1)     < num_vectors) {
+               efree(args);
+               WRONG_PARAM_COUNT;
+       }
        vector_array = emalloc(sizeof(struct iovec)*(num_vectors+1));
 
        for (i = 0, j = 1; i < num_vectors; i++, j++) {