[USBHUB] USBH_FdoQueryBusRelations: Fix an off by one (#9298)

Fix an out of bounds heap read when compacting the ghost device list.

Change the loop condition from `GhostPort < DeviceRelations->Count` to
`GhostPort < DeviceRelations->Count - 1` so the array shift never reads
past the last valid entry.
This commit is contained in:
Alex Mendoza
2026-07-17 22:48:18 +03:00
committed by GitHub
parent a4c863062f
commit ae50d745ca
+1 -1
View File
@@ -1392,7 +1392,7 @@ RelationsWorker:
if (PdoExt(PdoDevice)->EnumFlags & USBHUB_ENUM_FLAG_GHOST_DEVICE)
{
for (GhostPort = Port;
GhostPort < DeviceRelations->Count;
GhostPort < DeviceRelations->Count - 1;
GhostPort++)
{
DeviceRelations->Objects[GhostPort] =