php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 0001-fix-69472-return-value-0-by-GetFinalPathNameByHandle.patch for Filesystem function related Bug #69472

Patch version 2015-04-16 19:12 UTC

Return to Bug #69472 | Download this patch
Patch Revisions:

Developer: jan.starke@outofbed.org

From e5e2f51c0c6ac4b336b236baaca87782d68c3f1d Mon Sep 17 00:00:00 2001
From: Jan Starke <jan.starke@outofbed.org>
Date: Thu, 16 Apr 2015 21:10:51 +0200
Subject: [PATCH] fix #69472: return value 0 by GetFinalPathNameByHandleA is
 handled

---
 Zend/zend_virtual_cwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 70b4265..28cc7f6 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -261,7 +261,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
 	}
 
 	dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS);
-	if(dwRet >= MAXPATHLEN) {
+	if(dwRet >= MAXPATHLEN || dwRet == 0) {
 		return -1;
 	}
 
-- 
2.3.2 (Apple Git-55)

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 16:01:27 2019 UTC