Re: cvs: php4 /main user_streams.c
| From: | Markus Fischer | Date: | Tue, 19 Mar 2002 14:41:38 +0000 |
| Subject: | Re: cvs: php4 /main user_streams.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-10421@lists.php.net to get a copy of this message | ||
Would it be possible to expose exactly how many bytes were
written to much and what the allowed maximum would be?
- Markus
On Tue, Mar 19, 2002 at 01:44:38PM -0000, Wez Furlong wrote :
> wez Tue Mar 19 08:44:38 2002 EDT
>
> Modified files:
> /php4/main user_streams.c
> Log:
> avoid possible buffer overruns when write returns a value larger than the buffer
>
> Index: php4/main/user_streams.c
> diff -u php4/main/user_streams.c:1.2 php4/main/user_streams.c:1.3
> --- php4/main/user_streams.c:1.2 Tue Mar 19 08:42:25 2002
> +++ php4/main/user_streams.c Tue Mar 19 08:44:38 2002
> @@ -249,6 +249,13 @@
> didwrite = Z_LVAL_P(retval);
> else
> didwrite = 0;
> +
> + /* don't allow strange buffer overruns due to bogus return */
> + if (didwrite > count) {
> + zend_error(E_WARNING, "%s::" USERSTREAM_READ " - wrote more data than
> requested",
> + us->wrapper->classname);
> + didwrite = count;
> + }
>
> if (retval)
> zval_ptr_dtor(&retval);
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc