From 7cd06f50882f1bc198a8fb19cd0ad6e56e01b7fb Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 27 Aug 2003 01:10:25 +0000 Subject: [PATCH] MFH: Prevent a crash when expand_filepath() fails. --- main/streams.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.50.1