You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

48 lines
1.6 KiB

From 0218acb7e756a469099c4ccfb22bce6c2bd1ef87 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev <stas@php.net>
Date: Tue, 12 Jul 2016 21:48:00 -0700
Subject: [PATCH] Fix for bug #72513
---
TSRM/tsrm_virtual_cwd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: php5-5.4.45/TSRM/tsrm_virtual_cwd.c
===================================================================
--- php5-5.4.45.orig/TSRM/tsrm_virtual_cwd.c 2016-08-19 15:33:24.000000000 +0200
+++ php5-5.4.45/TSRM/tsrm_virtual_cwd.c 2016-08-19 15:33:24.000000000 +0200
@@ -621,14 +621,14 @@
memcmp(path, (*bucket)->path, path_len) == 0) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
-
+
/* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
}
-
+
free(r);
return;
} else {
@@ -704,7 +704,7 @@
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
- /* if the pointers match then only subtract the length of the path */
+ /* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
@@ -1159,7 +1159,7 @@
int add_slash;
void *tmp;
- if (path_length == 0 || path_length >= MAXPATHLEN-1) {
+ if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
#ifdef TSRM_WIN32
# if _MSC_VER < 1300
errno = EINVAL;