]> granicus.if.org Git - php/commitdiff
Prevent a crash when expand_filepath() fails.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 27 Aug 2003 01:10:10 +0000 (01:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 27 Aug 2003 01:10:10 +0000 (01:10 +0000)
main/streams/plain_wrapper.c

index cc814f01ad3c50a0c50afc9c0413b5dcf087af81..f8fd0c9153e3be5c952210a2925de45c19f7feb4 100644 (file)
@@ -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);