[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH] Fix potential buffer overflow
The buffer allocation in FdoQueryDeviceRelations() is completely bogus. Fix it. Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> --- src/xenbus/fdo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c index cbd2d9a..8208111 100644 --- a/src/xenbus/fdo.c +++ b/src/xenbus/fdo.c @@ -3347,7 +3347,7 @@ FdoQueryDeviceRelations( ListEntry = ListEntry->Flink) Count++; - Size = FIELD_OFFSET(DEVICE_RELATIONS, Objects) + (sizeof (DEVICE_OBJECT) * __min(Count, 1)); + Size = FIELD_OFFSET(DEVICE_RELATIONS, Objects) + (sizeof (PDEVICE_OBJECT) * __max(Count, 1)); Relations = __AllocatePoolWithTag(PagedPool, Size, 'SUB'); -- 2.1.1 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |