From: Ilia Alshanetsky Date: Wed, 27 Aug 2003 01:10:10 +0000 (+0000) Subject: Prevent a crash when expand_filepath() fails. X-Git-Tag: RELEASE_0_7~446 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a326bde2e874e90e9e09847dabf2bdfc4df7fac8;p=php Prevent a crash when expand_filepath() fails. --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index cc814f01ad..f8fd0c9153 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -100,7 +100,9 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha return NULL; } - realpath = expand_filepath(filename, NULL TSRMLS_CC); + if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) { + return NULL; + } if (persistent) { spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath);