xf86drm: cap number of reported devices by drmGetDevice(2)
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 5 Feb 2021 00:41:13 +0000 (00:41 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 10 Feb 2021 19:29:27 +0000 (19:29 +0000)
commit8cb12a2528d795c45bba5f03b3486b4040fb0f45
treefa09d724d80ad53843e851152b3f4321c9655654
parent19f0a9cb878da5beeddb9274f6f4cf0cea394672
xf86drm: cap number of reported devices by drmGetDevice(2)

Do as the documentation says - cap the number of reported devices to the
requested amount - aka max_devices. Otherwise we risk out-of-bound access
for users of the API.

Issue: https://gitlab.freedesktop.org/mesa/drm/-/issues/56
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
xf86drm.c