[USETUP] Check for invalid INF handles before doing operations.

This commit is contained in:
Hermès Bélusca-Maïto 2018-12-23 16:53:39 +01:00
parent 34e9290821
commit 9f1c8ac020
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -43,6 +43,8 @@ WINAPI
SetupCloseInfFile( SetupCloseInfFile(
IN HINF InfHandle) IN HINF InfHandle)
{ {
if (InfHandle == INVALID_HANDLE_VALUE)
return;
InfCloseFile(InfHandle); InfCloseFile(InfHandle);
} }
@ -58,6 +60,9 @@ SetupFindFirstLineW(
PINFCONTEXT pContext; PINFCONTEXT pContext;
BOOL ret; BOOL ret;
if (InfHandle == INVALID_HANDLE_VALUE)
return FALSE;
ret = InfFindFirstLine(InfHandle, Section, Key, &pContext); ret = InfFindFirstLine(InfHandle, Section, Key, &pContext);
if (!ret) if (!ret)
return FALSE; return FALSE;