Under certain situations, such as when input is being sent during driver
install or sleep transition, FdoCsqPeekNextIrp can be called with an
empty Fdo->List. In that case, FdoCsqPeekNextIrp dereferences the list
head and returns an invalid IRP; it should check for this error
condition.
Signed-off-by: Troy Crosley <troycrosley@gmail.com>
else
ListEntry = Irp->Tail.Overlay.ListEntry.Flink;
- NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
// should walk through the list until a match against Context is found
+ if (ListEntry != &Fdo->List)
+ NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
+ else
+ NextIrp = NULL;
+
return NextIrp;
}