The __min in XENFILT's FdoQueryDeviceRelations() should be a __max. The only
reason this mistake did not lead to an immediate buffer overflow was because
the allocation incorrectly used sizeof (DEVICE_OBJECT) rather than
sizeof (PDEVICE_OBJECT).
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
}
Size = FIELD_OFFSET(DEVICE_RELATIONS, Objects) +
- (sizeof (DEVICE_OBJECT) * __min(Count, 1));
+ (sizeof (PDEVICE_OBJECT) * __max(Count, 1));
Relations = __AllocatePoolWithTag(PagedPool, Size, 'TLIF');