From: Uwe Schindler Date: Thu, 7 Apr 2005 07:29:14 +0000 (+0000) Subject: Bug #32614 - prevent from crahsing with segfault on solaris if fdopen() fails - this... X-Git-Tag: php-5.0.1b1~590 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd47b3c54286e312f5f14437fe65411e100d4328;p=php Bug #32614 - prevent from crahsing with segfault on solaris if fdopen() fails - this fixes NOT the stdio-problem on solaris! --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index ad362cf45f..9e776db23e 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -461,6 +461,9 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) /* we were opened as a plain file descriptor, so we * need fdopen now */ data->file = fdopen(data->fd, stream->mode); + if (data->file == NULL) { + return FAILURE; + } } *(FILE**)ret = data->file;