diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-27 01:10:10 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-27 01:10:10 +0000 |
commit | a326bde2e874e90e9e09847dabf2bdfc4df7fac8 (patch) | |
tree | f5a6a53f701c498ae54ac6cc7155237e4ffafd77 /main/streams/plain_wrapper.c | |
parent | 3560cd83c05a178ac76eb404784960b2f7069071 (diff) | |
download | php-git-a326bde2e874e90e9e09847dabf2bdfc4df7fac8.tar.gz |
Prevent a crash when expand_filepath() fails.
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r-- | main/streams/plain_wrapper.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |