com php-src: fix invalid write: win32/registry.c

From: Date: Fri, 06 Mar 2015 15:42:31 +0000
Subject: com php-src: fix invalid write: win32/registry.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85295@lists.php.net to get a copy of this message
Commit: 9577a20b3b0ee61e72218393f30c535d06b77ede Author: Anatol Belski <ab@php.net> Fri, 6 Mar 2015 16:41:57 +0100 Parents: 66f5a1e8b4de3c691a5de84fb08715c78401bf6b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9577a20b3b0ee61e72218393f30c535d06b77ede Log: fix invalid write Changed paths: M win32/registry.c Diff: diff --git a/win32/registry.c b/win32/registry.c index 30278fa..f44e71a 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -240,7 +240,7 @@ void UpdateIniFromRegistry(char *path) } zend_str_tolower(path, path_len); - while (path_len >= 0) { + while (path_len > 0) { HashTable *ht = (HashTable *)zend_hash_str_find_ptr(PW32G(registry_directories), path, path_len); if (ht != NULL) { @@ -252,11 +252,9 @@ void UpdateIniFromRegistry(char *path) } ZEND_HASH_FOREACH_END(); } - if (--path_len > 0) { - while (path_len > 0 && path[path_len] != '/') { - path_len--; - } - } + do { + path_len--; + } while (path_len > 0 && path[path_len] != '/'); path[path_len] = 0; }

« previous php.cvs (#85295) next »