]> granicus.if.org Git - php/commitdiff
- sb needed only in safemode
authorPierre Joye <pajoye@php.net>
Wed, 1 Sep 2010 10:13:46 +0000 (10:13 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 1 Sep 2010 10:13:46 +0000 (10:13 +0000)
main/streams/plain_wrapper.c

index 4363a38678b211e15b59f6d73dcd0d4bde5cecfe..c1686eec9fcc9dcc9f3190384f4ece40eca1bc9d 100644 (file)
@@ -1306,7 +1306,6 @@ PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char
        char *pathbuf, *ptr, *end;
        char *exec_fname;
        char trypath[MAXPATHLEN];
-       struct stat sb;
        php_stream *stream;
        int path_length;
        int filename_length;
@@ -1448,6 +1447,8 @@ not_relative_path:
                }
                
                if (PG(safe_mode)) {
+                       struct stat sb;
+
                        if (VCWD_STAT(trypath, &sb) == 0) {
                                /* file exists ... check permission */
                                if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) ||