]> 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)
committerXinchen Hui <laruence@gmail.com>
Thu, 10 Mar 2016 06:24:13 +0000 (14:24 +0800)
Zend/zend_virtual_cwd.c

index 5e2189c6d9c9fbd4a4576cf9642bcf1b48ae22da..969d09e8dd8020daaf13584618da3eae940553d4 100644 (file)
@@ -597,12 +597,13 @@ static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {
        register zend_ulong h;
        char *bucket_key_start = tsrm_win32_get_path_sid_key(path);
        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 = Z_UL(2166136261); bucket_key < e;) {
                h *= Z_UL(16777619);
                h ^= *bucket_key++;