]> granicus.if.org Git - php/commitdiff
Bug #32614 - prevent from crahsing with segfault on solaris if fdopen() fails - this...
authorUwe Schindler <thetaphi@php.net>
Thu, 7 Apr 2005 07:29:14 +0000 (07:29 +0000)
committerUwe Schindler <thetaphi@php.net>
Thu, 7 Apr 2005 07:29:14 +0000 (07:29 +0000)
main/streams/plain_wrapper.c

index ad362cf45fced498a0f929c62d1e05c463a104b0..9e776db23ef4394cb78c3e2d43faf4de842c6147 100644 (file)
@@ -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;