mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
radv: fix possible stack corruption
drmGetDevices2 takes count and not size. Probably hasn't caused problems yet in practice and was missed as setups with more than 8 DRM devices are not very common. Fixes:743315f2"radv: do not open random render node(s)" Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (cherry picked from commit898cbb491b)
This commit is contained in:
parent
7bbece985e
commit
64b98a1e72
1 changed files with 1 additions and 1 deletions
|
|
@ -401,7 +401,7 @@ radv_enumerate_devices(struct radv_instance *instance)
|
|||
|
||||
instance->physicalDeviceCount = 0;
|
||||
|
||||
max_devices = drmGetDevices2(0, devices, sizeof(devices));
|
||||
max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
|
||||
if (max_devices < 1)
|
||||
return VK_ERROR_INCOMPATIBLE_DRIVER;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue