Skip to content

Commit

Permalink
[SETUPAPI] CM_Request_Device_Eject_ExA/W: Fix pszVetoName buffer size…
Browse files Browse the repository at this point in the history
… validation

Verified with Windows 2003 SP2.
  • Loading branch information
TAN-Gaming committed Nov 10, 2023
1 parent 565bf9e commit 932c466
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dll/win32/setupapi/cfgmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -7489,7 +7489,7 @@ CM_Request_Device_Eject_ExA(
TRACE("CM_Request_Device_Eject_ExA(%lx %p %s %lu %lx %p)\n",
dnDevInst, pVetoType, debugstr_a(pszVetoName), ulNameLength, ulFlags, hMachine);

if (pszVetoName == NULL && ulNameLength == 0)
if (pszVetoName == NULL && ulNameLength != 0)
return CR_INVALID_POINTER;

lpLocalVetoName = HeapAlloc(GetProcessHeap(), 0, ulNameLength * sizeof(WCHAR));
Expand Down Expand Up @@ -7544,7 +7544,7 @@ CM_Request_Device_Eject_ExW(
if (ulFlags != 0)
return CR_INVALID_FLAG;

if (pszVetoName == NULL && ulNameLength == 0)
if (pszVetoName == NULL && ulNameLength != 0)
return CR_INVALID_POINTER;

if (hMachine != NULL)
Expand Down

0 comments on commit 932c466

Please sign in to comment.