[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
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

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");