From f8d7d6fc905c8a68088fb917dc13e471fbd88256 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 29 Jan 2008 14:23:19 +0000 Subject: [PATCH] Fixed bug #43491 (Under certain conditions, file_exists() never returns) --- NEWS | 2 ++ main/fopen_wrappers.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index a04bc3ad45..4d38dc9c2c 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,8 @@ PHP NEWS allowed in ASCII mode). (Ilia, crrodriguez at suse dot de) - Fixed bug #43493 (pdo_pgsql does not send username on connect when password is not available). (Ilia) +- Fixed bug #43491 (Under certain conditions, file_exists() never returns). + (Dmitry) - Fixed bug #43482 (array_pad() does not warn on very small pad numbers). (Ilia) - Fixed bug #43457 (Prepared statement with incorrect parms doesn't throw diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index ce5aa60b66..736da15b0d 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -148,6 +148,9 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path path_len = path_file - path_tmp + 1; #if defined(PHP_WIN32) || defined(NETWARE) if (path_len > 1 && path_tmp[path_len - 2] == ':') { + if (path_len != 3) { + return -1; + } /* this is c:\ */ path_tmp[path_len] = '\0'; } else { -- 2.50.1