]> granicus.if.org Git - php/commitdiff
tsrm_win32_get_path_sid_key might returns NULL (Partially fix bug #71752)
authorXinchen Hui <laruence@gmail.com>
Thu, 10 Mar 2016 06:24:13 +0000 (14:24 +0800)
committerAnatol Belski <ab@php.net>
Thu, 10 Mar 2016 08:33:39 +0000 (09:33 +0100)
cherry-picked from 7d5f71b0b125c89211e5a2a6d925deba938abd41

Zend/zend_virtual_cwd.c

index 32d6ab8f8570922da317fb181e94e89ff47ddbe7..512a3037615b5585fc98e29fd2e71bc6b12d5151 100644 (file)
@@ -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++;