From acb27cdc6b1cb31f4a0145b651f5af639bff4780 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 26 Apr 2015 04:10:25 +0000 Subject: [PATCH] [USERENV] - Add space for terminator to values returned from RegQueryInfoKey CORE-6976 svn path=/trunk/; revision=67428 --- reactos/dll/win32/userenv/environment.c | 1 + reactos/dll/win32/userenv/registry.c | 3 +++ 2 files changed, 4 insertions(+) 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); -- 2.17.1