mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[SETUPAPI] Add missing NULL parameter checks in SetupOpenInfFileW and SetupDiGetINFClassW.
Based on PR #5673, ROSTESTS-388 Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
This commit is contained in:
parent
2788057a2d
commit
0632def000
@ -1232,11 +1232,18 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err
|
||||
|
||||
TRACE("%s %s %lx %p\n", debugstr_w(name), debugstr_w(class), style, error);
|
||||
|
||||
#ifdef __REACTOS__
|
||||
if (style & ~(INF_STYLE_OLDNT | INF_STYLE_WIN4))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return (HINF)INVALID_HANDLE_VALUE;
|
||||
}
|
||||
if (!name)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return (HINF)INVALID_HANDLE_VALUE;
|
||||
}
|
||||
#endif // __REACTOS__
|
||||
|
||||
if (wcschr( name, '\\' ) || wcschr( name, '/' ))
|
||||
{
|
||||
@ -2329,6 +2336,12 @@ SetupDiGetINFClassW(
|
||||
TRACE("%s %p %p %ld %p\n", debugstr_w(InfName), ClassGuid,
|
||||
ClassName, ClassNameSize, RequiredSize);
|
||||
|
||||
if (!InfName || !ClassGuid || !ClassName || ClassNameSize == 0)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Open .inf file */
|
||||
hInf = SetupOpenInfFileW(InfName, NULL, INF_STYLE_WIN4, NULL);
|
||||
if (hInf == INVALID_HANDLE_VALUE)
|
||||
|
Loading…
Reference in New Issue
Block a user