mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 02:43:48 +00:00
fix some heap corruptions in services
svn path=/trunk/; revision=36131
This commit is contained in:
parent
3460318121
commit
eac6a1546a
|
@ -61,7 +61,7 @@ ScmSetServiceGroup(PSERVICE lpService,
|
||||||
|
|
||||||
lpGroup = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
lpGroup = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(SERVICE_GROUP) + (wcslen(lpGroupName) * sizeof(WCHAR)));
|
sizeof(SERVICE_GROUP) + ((wcslen(lpGroupName) + 1)* sizeof(WCHAR)));
|
||||||
if (lpGroup == NULL)
|
if (lpGroup == NULL)
|
||||||
return ERROR_NOT_ENOUGH_MEMORY;
|
return ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ CreateGroupListRoutine(PWSTR ValueName,
|
||||||
|
|
||||||
Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(SERVICE_GROUP) + (wcslen((const wchar_t*) ValueData) * sizeof(WCHAR)));
|
sizeof(SERVICE_GROUP) + ((wcslen((const wchar_t*) ValueData) + 1) * sizeof(WCHAR)));
|
||||||
if (Group == NULL)
|
if (Group == NULL)
|
||||||
{
|
{
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
|
@ -164,7 +164,7 @@ ScmCreateManagerHandle(LPWSTR lpDatabaseName,
|
||||||
|
|
||||||
Ptr = (MANAGER_HANDLE*) HeapAlloc(GetProcessHeap(),
|
Ptr = (MANAGER_HANDLE*) HeapAlloc(GetProcessHeap(),
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(MANAGER_HANDLE) + wcslen(lpDatabaseName) * sizeof(WCHAR));
|
sizeof(MANAGER_HANDLE) + (wcslen(lpDatabaseName) + 1) * sizeof(WCHAR));
|
||||||
if (Ptr == NULL)
|
if (Ptr == NULL)
|
||||||
return ERROR_NOT_ENOUGH_MEMORY;
|
return ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue