Re: [PATCH] Check the return value of do_fstat() to avoid error conditions.
| From: | Yasuo Ohgaki | Date: | Tue, 27 Jan 2015 00:35:57 +0000 |
| Subject: | Re: [PATCH] Check the return value of do_fstat() to avoid error conditions. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81186@lists.php.net to get a copy of this message | ||
Hi all,
On Thu, Jan 15, 2015 at 5:04 PM, Joshua Rogers <honey@internot.info> wrote:
> main/streams/plain_wrapper.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
> index f52383d..72be0b0 100644
> --- a/main/streams/plain_wrapper.c
> +++ b/main/streams/plain_wrapper.c
> @@ -669,7 +669,8 @@ static int php_stdiop_set_option(php_stream *stream,
> int option, int value, void
> return fd == -1 ?
> PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
>
> case PHP_STREAM_MMAP_MAP_RANGE:
> - do_fstat(data, 1);
> + if(do_fstat(data, 1)<0)
> + return -1;
> if (range->length == 0 &&
> range->offset > 0 && range->offset < data->sb.st_size) {
> range->length =
> data->sb.st_size - range->offset;
> }
>
This patch seems reasonable. Does anyone taking care of this?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net