summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-03-17 19:14:41 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-03-17 19:14:41 +0000
commit59061816309c9edce4aaade87fdf335fd6318e51 (patch)
tree4296a4178f3cab0821bc4f66e871d5983af8fa12 /user
parent549c7c770556007846949f995e550ae44244d91f (diff)
downloadlibapr-59061816309c9edce4aaade87fdf335fd6318e51.tar.gz
Provide the correct buffer size (in wchars) to ExpandEnvironmentStringsW
Reported by: Sebastian Gottschalk <seppi seppig.de> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@638031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r--user/win32/userinfo.c3
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;