From: Ilia Alshanetsky Date: Wed, 27 Aug 2003 01:10:25 +0000 (+0000) Subject: MFH: Prevent a crash when expand_filepath() fails. X-Git-Tag: php-4.3.4RC1~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cd06f50882f1bc198a8fb19cd0ad6e56e01b7fb;p=php MFH: Prevent a crash when expand_filepath() fails. --- diff --git a/main/streams.c b/main/streams.c index c3154f338a..8c32855e04 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1943,7 +1943,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);