[USERENV]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 26 Apr 2015 04:10:25 +0000 (04:10 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 26 Apr 2015 04:10:25 +0000 (04:10 +0000)
- Add space for terminator to values returned from RegQueryInfoKey
CORE-6976

svn path=/trunk/; revision=67428

reactos/dll/win32/userenv/environment.c
reactos/dll/win32/userenv/registry.c

index 20c1b0f..ccb36d8 100644 (file)
@@ -340,6 +340,7 @@ SetUserEnvironment(LPVOID *lpEnvironment,
     }
 
     /* Allocate buffers */
     }
 
     /* Allocate buffers */
+    dwMaxValueNameLength++;
     lpValueName = LocalAlloc(LPTR,
                              dwMaxValueNameLength * sizeof(WCHAR));
     if (lpValueName == NULL)
     lpValueName = LocalAlloc(LPTR,
                              dwMaxValueNameLength * sizeof(WCHAR));
     if (lpValueName == NULL)
index 196a511..7be864c 100644 (file)
@@ -89,6 +89,9 @@ CopyKey(HKEY hDstKey,
         return FALSE;
     }
 
         return FALSE;
     }
 
+    dwMaxSubKeyNameLength++;
+    dwMaxValueNameLength++;
+
     DPRINT("dwSubKeys %lu\n", dwSubKeys);
     DPRINT("dwMaxSubKeyNameLength %lu\n", dwMaxSubKeyNameLength);
     DPRINT("dwValues %lu\n", dwValues);
     DPRINT("dwSubKeys %lu\n", dwSubKeys);
     DPRINT("dwMaxSubKeyNameLength %lu\n", dwMaxSubKeyNameLength);
     DPRINT("dwValues %lu\n", dwValues);