]> 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:28:53 +0000 (07:28 +0000)
committerUwe Schindler <thetaphi@php.net>
Thu, 7 Apr 2005 07:28:53 +0000 (07:28 +0000)
main/streams/plain_wrapper.c

index 041b36b40cc11dbc0e79c3cd1cce29cd8e977f38..a18851e8812dfa79ce7c5f3c39122d12dcbbdb83 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;