mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 05:58:13 +00:00
fix some heap corruptions in services
svn path=/trunk/; revision=36131
This commit is contained in:
parent
3460318121
commit
eac6a1546a
2 changed files with 3 additions and 3 deletions
|
@ -61,7 +61,7 @@ ScmSetServiceGroup(PSERVICE lpService,
|
|||
|
||||
lpGroup = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(SERVICE_GROUP) + (wcslen(lpGroupName) * sizeof(WCHAR)));
|
||||
sizeof(SERVICE_GROUP) + ((wcslen(lpGroupName) + 1)* sizeof(WCHAR)));
|
||||
if (lpGroup == NULL)
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
|
||||
|
@ -144,7 +144,7 @@ CreateGroupListRoutine(PWSTR ValueName,
|
|||
|
||||
Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(),
|
||||
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)
|
||||
{
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
|
|
@ -164,7 +164,7 @@ ScmCreateManagerHandle(LPWSTR lpDatabaseName,
|
|||
|
||||
Ptr = (MANAGER_HANDLE*) HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(MANAGER_HANDLE) + wcslen(lpDatabaseName) * sizeof(WCHAR));
|
||||
sizeof(MANAGER_HANDLE) + (wcslen(lpDatabaseName) + 1) * sizeof(WCHAR));
|
||||
if (Ptr == NULL)
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
|
||||
|
|
Loading…
Reference in a new issue