Author: khornicek
Date: Wed Oct 22 12:13:40 2014
New Revision: 64884
URL:
http://svn.reactos.org/svn/reactos?rev=64884&view=rev
Log:
[MSCONFIG]
- fix CID 503793 (unlikely NULL pointer dereference), 514558 (check return value)
Modified:
trunk/reactos/base/applications/msconfig/srvpage.c
trunk/reactos/base/applications/msconfig/startuppage.c
Modified: trunk/reactos/base/applications/msconfig/srvpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/srvpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/msconfig/srvpage.c [iso-8859-1] Wed Oct 22 12:13:40
2014
@@ -187,19 +187,16 @@
return;
}
}
- if (pServiceFailureActions->cActions)
- {
- if (pServiceFailureActions->lpsaActions[0].Type ==
SC_ACTION_REBOOT)
- {
- LoadString(hInst, IDS_SERVICES_YES, szStatus, 128);
- item.pszText = szStatus;
- item.iSubItem = 1;
- SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem,
(LPARAM) &item);
- }
- }
if (pServiceFailureActions != NULL)
{
+ if (pServiceFailureActions->cActions &&
pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT)
+ {
+ LoadString(hInst, IDS_SERVICES_YES, szStatus, 128);
+ item.pszText = szStatus;
+ item.iSubItem = 1;
+ SendMessage(hServicesListCtrl, LVM_SETITEMTEXT,
item.iItem, (LPARAM) &item);
+ }
HeapFree(GetProcessHeap(), 0, pServiceFailureActions);
pServiceFailureActions = NULL;
}
Modified: trunk/reactos/base/applications/msconfig/startuppage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/startuppage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/msconfig/startuppage.c [iso-8859-1] Wed Oct 22
12:13:40 2014
@@ -97,7 +97,11 @@
if (Data == NULL)
break;
- RegEnumKeyEx(hKey, Index, szValueName, &dwValueLength, NULL, NULL,
NULL, NULL);
+ if(RegEnumKeyEx(hKey, Index, szValueName, &dwValueLength, NULL, NULL,
NULL, NULL) != ERROR_SUCCESS)
+ {
+ HeapFree(GetProcessHeap(), 0, Data);
+ continue;
+ }
_stprintf(szSubPath, _T("%s\\%s"), szBasePath, szValueName);
memset(&item, 0, sizeof(LV_ITEM));
item.mask = LVIF_TEXT;