diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2008-03-17 19:14:41 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2008-03-17 19:14:41 +0000 |
commit | f166a5824c6341f7c748b3a18c9b7bec361de1a2 (patch) | |
tree | 4296a4178f3cab0821bc4f66e871d5983af8fa12 /user | |
parent | 594e0323c96eba18e6767a515aba7d69a2cc0a10 (diff) | |
download | apr-f166a5824c6341f7c748b3a18c9b7bec361de1a2.tar.gz |
Provide the correct buffer size (in wchars) to ExpandEnvironmentStringsW
Reported by: Sebastian Gottschalk <seppi seppig.de>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@638031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r-- | user/win32/userinfo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index aae3f9bec..3d45df4f3 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -121,7 +121,8 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, else if (type == REG_EXPAND_SZ) { apr_wchar_t path[MAX_PATH]; char retdir[MAX_PATH]; - ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, sizeof(path)); + ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, + sizeof(path) / 2); if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), path)) != APR_SUCCESS) return rv; |