[SERVICES] Fix booting with DPH enabled

RegSetValueExW tries to read one extra character after the buffer,
to see if a REG_SZ is null terminated
This commit is contained in:
Mark Jansen
2021-04-03 01:54:57 +02:00
parent 5028c3adec
commit 97a23a5f3d

View File

@@ -174,9 +174,10 @@ ScmCopyTree(
return ERROR_NOT_ENOUGH_MEMORY;
}
/* RegSetValueExW tries to read behind the maximum length, so give it space for that */
lpDataBuffer = HeapAlloc(GetProcessHeap(),
0,
dwMaxValueLength);
HEAP_ZERO_MEMORY,
dwMaxValueLength + sizeof(WCHAR));
if (lpDataBuffer == NULL)
{
DPRINT1("Buffer allocation failed\n");