apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r638032 - /apr/apr/branches/1.2.x/user/win32/userinfo.c
Date Mon, 17 Mar 2008 19:15:12 GMT
Author: wrowe
Date: Mon Mar 17 12:15:10 2008
New Revision: 638032

URL: http://svn.apache.org/viewvc?rev=638032&view=rev
Log:
Provide the correct buffer size (in wchars) to ExpandEnvironmentStringsW

Reported by: Sebastian Gottschalk <seppi seppig.de>
Backports: 638031

Modified:
    apr/apr/branches/1.2.x/user/win32/userinfo.c

Modified: apr/apr/branches/1.2.x/user/win32/userinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/user/win32/userinfo.c?rev=638032&r1=638031&r2=638032&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/user/win32/userinfo.c (original)
+++ apr/apr/branches/1.2.x/user/win32/userinfo.c Mon Mar 17 12:15:10 2008
@@ -121,7 +121,8 @@
         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;



Mime
View raw message