From: Scott MacVicar Date: Tue, 9 Oct 2007 10:04:19 +0000 (+0000) Subject: Fix expand_filepath when including relative files, ideally you should test you code... X-Git-Tag: RELEASE_2_0_0a1~1625 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ba8a98fd3d9a1a761f6fe5a5ad4aa7cadbd341c;p=php Fix expand_filepath when including relative files, ideally you should test you code... --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 920de5e824..265505acf5 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -593,8 +593,10 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC) copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); real_path = estrndup(filepath, copy_len); return real_path; + } else { + cwd[0] = '\0'; } - } else { + } else if (!result) { cwd[0] = '\0'; } }