cvs: php-src /win32 registry.c
| From: | Dmitry Stogov | Date: | Sun, 22 Apr 2007 10:25:51 +0000 |
| Subject: | cvs: php-src /win32 registry.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-44022@lists.php.net to get a copy of this message | ||
dmitry Sun Apr 22 10:25:51 2007 UTC
Modified files:
/php-src/win32 registry.c
Log:
Fixed buffer overflow
http://cvs.php.net/viewvc.cgi/php-src/win32/registry.c?r1=1.19&r2=1.20&diff_format=u
Index: php-src/win32/registry.c
diff -u php-src/win32/registry.c:1.19 php-src/win32/registry.c:1.20
--- php-src/win32/registry.c:1.19 Sat Feb 24 16:25:55 2007
+++ php-src/win32/registry.c Sun Apr 22 10:25:51 2007
@@ -133,10 +133,12 @@
if (path_len) {
memcpy(new_path, path, path_len);
new_path[path_len] = '/';
- path_len++;
+ memcpy(new_path+path_len+1, name, name_len+1);
+ zend_str_tolower(new_path, path_len+name_len+1);
+ } else {
+ memcpy(new_path, name, name_len+1);
+ zend_str_tolower(new_path, name_len);
}
- memcpy(new_path+path_len, name, name_len+1);
- zend_str_tolower(new_path, path_len+name_len);
if (LoadDirectory(directories, subkey, new_path, path_len+name_len, ht)) {
ret = 1;
}