summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-12-06 15:30:44 +0000
committerZeev Suraski <zeev@php.net>1999-12-06 15:30:44 +0000
commit5df43c134f6793d9364fd1c877ae57e9a110ad04 (patch)
tree45ca393f2b568d3a0ab22243287749396cf42968
parent5201f90588aeb6d59b96001998f1bf421fb8e56c (diff)
downloadphp-git-5df43c134f6793d9364fd1c877ae57e9a110ad04.tar.gz
opened_path could end up uninitialized - fixed
-rw-r--r--main/fopen_wrappers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 2e0d317446..c3f32dd15b 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -186,6 +186,10 @@ PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock
int cm=2; /* checkuid mode: 2 = if file does not exist, check directory */
PLS_FETCH();
+ if (opened_path) {
+ *opened_path = NULL;
+ }
+
/* FIXME Lets not get in the habit of doing stuff like this. This should
be runtime enabled, NOT compile time. */
#if PHP3_URL_FOPEN
@@ -320,10 +324,11 @@ PHPAPI FILE *php3_fopen_with_path(char *filename, char *mode, char *path, char *
int cm=2;
PLS_FETCH();
- if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
if (opened_path) {
*opened_path = NULL;
}
+
+ if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
/* Relative path open */
if (*filename == '.') {
if (PG(safe_mode) && (!_php3_checkuid(filename, cm))) {