From: Pierre Joye Date: Wed, 1 Sep 2010 10:13:46 +0000 (+0000) Subject: - sb needed only in safemode X-Git-Tag: php-5.3.4RC1~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87bf415853809bad3e1214ce5754702fdd887210;p=php - sb needed only in safemode --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 4363a38678..c1686eec9f 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -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) ||