https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f1c8ac02013b07428665…
commit 9f1c8ac02013b0742866531cf7383c168b69857c
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Dec 23 16:53:39 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Dec 23 20:37:13 2018 +0100
[USETUP] Check for invalid INF handles before doing operations.
---
base/setup/usetup/spapisup/infsupp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/base/setup/usetup/spapisup/infsupp.c b/base/setup/usetup/spapisup/infsupp.c
index af18c491c1..98212975cb 100644
--- a/base/setup/usetup/spapisup/infsupp.c
+++ b/base/setup/usetup/spapisup/infsupp.c
@@ -43,6 +43,8 @@ WINAPI
SetupCloseInfFile(
IN HINF InfHandle)
{
+ if (InfHandle == INVALID_HANDLE_VALUE)
+ return;
InfCloseFile(InfHandle);
}
@@ -58,6 +60,9 @@ SetupFindFirstLineW(
PINFCONTEXT pContext;
BOOL ret;
+ if (InfHandle == INVALID_HANDLE_VALUE)
+ return FALSE;
+
ret = InfFindFirstLine(InfHandle, Section, Key, &pContext);
if (!ret)
return FALSE;