From: Thomas Faber Date: Sun, 26 Apr 2015 04:10:25 +0000 (+0000) Subject: [USERENV] X-Git-Tag: backups/colins-printing-for-freedom@73041~188 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=acb27cdc6b1cb31f4a0145b651f5af639bff4780 [USERENV] - Add space for terminator to values returned from RegQueryInfoKey CORE-6976 svn path=/trunk/; revision=67428 --- diff --git a/reactos/dll/win32/userenv/environment.c b/reactos/dll/win32/userenv/environment.c index 20c1b0f6721..ccb36d83664 100644 --- a/reactos/dll/win32/userenv/environment.c +++ b/reactos/dll/win32/userenv/environment.c @@ -340,6 +340,7 @@ SetUserEnvironment(LPVOID *lpEnvironment, } /* Allocate buffers */ + dwMaxValueNameLength++; lpValueName = LocalAlloc(LPTR, dwMaxValueNameLength * sizeof(WCHAR)); if (lpValueName == NULL) diff --git a/reactos/dll/win32/userenv/registry.c b/reactos/dll/win32/userenv/registry.c index 196a5112563..7be864cdcb2 100644 --- a/reactos/dll/win32/userenv/registry.c +++ b/reactos/dll/win32/userenv/registry.c @@ -89,6 +89,9 @@ CopyKey(HKEY hDstKey, return FALSE; } + dwMaxSubKeyNameLength++; + dwMaxValueNameLength++; + DPRINT("dwSubKeys %lu\n", dwSubKeys); DPRINT("dwMaxSubKeyNameLength %lu\n", dwMaxSubKeyNameLength); DPRINT("dwValues %lu\n", dwValues);