Author: hbelusca
Date: Sun Sep 3 20:05:11 2017
New Revision: 75755
URL:
http://svn.reactos.org/svn/reactos?rev=75755&view=rev
Log:
[SETUPLIB]: Use strsafe functions.
Modified:
branches/setup_improvements/base/setup/lib/utils/bldrsup.c
branches/setup_improvements/base/setup/lib/utils/genlist.c
Modified: branches/setup_improvements/base/setup/lib/utils/bldrsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/utils/bldrsup.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/utils/bldrsup.c [iso-8859-1] Sun Sep 3
20:05:11 2017
@@ -999,13 +999,13 @@
return STATUS_INSUFFICIENT_RESOURCES;
*Buffer = UNICODE_NULL;
- if (IsNameNotQuoted) wcscat(Buffer, L"\"");
- wcscat(Buffer, InstallName);
- if (IsNameNotQuoted) wcscat(Buffer, L"\"");
+ if (IsNameNotQuoted) StringCchCatW(Buffer, BufferLength, L"\"");
+ StringCchCatW(Buffer, BufferLength, InstallName);
+ if (IsNameNotQuoted) StringCchCatW(Buffer, BufferLength, L"\"");
if (OsOptions)
{
- wcscat(Buffer, L" ");
- wcscat(Buffer, OsOptions);
+ StringCchCatW(Buffer, BufferLength, L" ");
+ StringCchCatW(Buffer, BufferLength, OsOptions);
}
/* Insert the entry into the "Operating Systems" section */
Modified: branches/setup_improvements/base/setup/lib/utils/genlist.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/utils/genlist.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/utils/genlist.c [iso-8859-1] Sun Sep 3
20:05:11 2017
@@ -23,9 +23,7 @@
{
PGENERIC_LIST List;
- List = (PGENERIC_LIST)RtlAllocateHeap(ProcessHeap,
- 0,
- sizeof(GENERIC_LIST));
+ List = RtlAllocateHeap(ProcessHeap, 0, sizeof(GENERIC_LIST));
if (List == NULL)
return NULL;
@@ -72,15 +70,15 @@
IN BOOLEAN Current)
{
PGENERIC_LIST_ENTRY Entry;
+ SIZE_T TextSize;
- Entry = (PGENERIC_LIST_ENTRY)RtlAllocateHeap(ProcessHeap,
- 0,
- sizeof(GENERIC_LIST_ENTRY) +
- (wcslen(Text) + 1) * sizeof(WCHAR));
+ TextSize = (wcslen(Text) + 1) * sizeof(WCHAR);
+ Entry = RtlAllocateHeap(ProcessHeap, 0,
+ sizeof(GENERIC_LIST_ENTRY) + TextSize);
if (Entry == NULL)
return FALSE;
- wcscpy(Entry->Text, Text);
+ StringCbCopyW(Entry->Text, TextSize, Text);
Entry->List = List;
Entry->UserData = UserData;