Re: FW: php4(PHP_4_3) /ext/sockets sockets.c

From: Date: Mon, 24 Mar 2003 20:38:22 +0000
Subject: Re: FW: php4(PHP_4_3) /ext/sockets sockets.c
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-232@lists.php.net to get a copy of this message
I fixed this in 4.3, but the basic problem is that the API is braindead for this socket_iovec_alloc() function. We shouldn't need to pass the number of vectors as the first argument, it should just take the vectors directly and the function can figure out how many were passed. So, I think I'd rather change the API for php5 than merge this fix in. -Rasmus > rasmus Mon Mar 24 14:28:58 2003 EDT > > Modified files: (Branch: PHP_4_3) > /php4/ext/sockets sockets.c > Log: > Fix arg list segfault > > > Index: php4/ext/sockets/sockets.c > diff -u php4/ext/sockets/sockets.c:1.125.2.5 > php4/ext/sockets/sockets.c:1.125.2.6 > --- php4/ext/sockets/sockets.c:1.125.2.5 Mon Mar 10 10:57:07 2003 > +++ php4/ext/sockets/sockets.c Mon Mar 24 14:28:58 2003 > @@ -19,7 +19,7 @@ > > +----------------------------------------------------------------------+ > */ > > -/* $Id: sockets.c,v 1.125.2.5 2003/03/10 15:57:07 ddhill Exp $ */ > +/* $Id: sockets.c,v 1.125.2.6 2003/03/24 19:28:58 rasmus Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" > @@ -1106,7 +1106,11 @@ > > 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++) { > > >

« previous php.internals (#232) next »