summaryrefslogtreecommitdiff
path: root/Zend/zend_virtual_cwd.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-03-10 14:24:13 +0800
committerAnatol Belski <ab@php.net>2016-03-10 09:33:39 +0100
commit67f0770036f866f6f0dadc044cdc8f94a5b9f030 (patch)
tree3b561fb35a1a92f5928fada776ee391fa7ca2ee8 /Zend/zend_virtual_cwd.c
parent915a3762ef71526d6deddf95bf42a6d5bf5211f3 (diff)
downloadphp-git-67f0770036f866f6f0dadc044cdc8f94a5b9f030.tar.gz
tsrm_win32_get_path_sid_key might returns NULL (Partially fix bug #71752)
cherry-picked from 7d5f71b0b125c89211e5a2a6d925deba938abd41
Diffstat (limited to 'Zend/zend_virtual_cwd.c')
-rw-r--r--Zend/zend_virtual_cwd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 32d6ab8f85..512a303761 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -587,12 +587,14 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len TS
register unsigned long h;
char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
char *bucket_key = (char *)bucket_key_start;
- const char *e = bucket_key + strlen(bucket_key);
+ const char *e;
if (!bucket_key) {
return 0;
}
+ e = bucket_key + strlen(bucket_key);
+
for (h = 2166136261U; bucket_key < e;) {
h *= 16777619;
h ^= *bucket_key++;