From: Scott MacVicar Date: Tue, 9 Oct 2007 10:06:34 +0000 (+0000) Subject: MFH: Fix expand_filepath when including relative files, ideally you should test your... X-Git-Tag: php-5.2.5RC1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7deeb54fe1a3146755ae80264798014adbe987a0;p=php MFH: Fix expand_filepath when including relative files, ideally you should test your code... --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 70b07ef8b2..e0122ff152 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -621,8 +621,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'; } }