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

index c3154f338aa56f72c12041ba3c9d069f4e85ca17..8c32855e04362bf3d8be13b75f985d0c660c30cd 100755 (executable)
@@ -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);