xserver/dri3
Alan Coopersmith 4440c43c0c dri: prevent out-of-bounds read in dri3_fd_from_pixmap
Reported in #1817:

xwayland-24.1.6/redhat-linux-build/../dri3/dri3_screen.c:143:13:
 warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
xwayland-24.1.6/redhat-linux-build/../dri3/dri3_screen.c:143:13:
 danger: out-of-bounds read from byte 16 till byte 19
 but ‘fds’ ends at byte 16
141|           int i;
142|           for (i = 0; i < num_fds; i++)
143|->             close(fds[i]);
144|           return -1;
145|       }

Only possible if fds_from_pixmap returns a value > 4, but the analyzer
doesn't know the interface is defined not to do that.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2085>
(cherry picked from commit f05f269f1d)
2026-01-25 10:40:03 -08:00
..
dri3.c DRI3: add DRI3ImportSyncobj and DRI3FreeSyncobj 2026-01-19 12:32:24 -08:00
dri3.h DRI3: add DRI3ImportSyncobj and DRI3FreeSyncobj 2026-01-19 12:32:24 -08:00
dri3_priv.h DRI3: add DRI3ImportSyncobj and DRI3FreeSyncobj 2026-01-19 12:32:24 -08:00
dri3_request.c dri3: drop swapping request length fields 2026-01-25 10:39:59 -08:00
dri3_screen.c dri: prevent out-of-bounds read in dri3_fd_from_pixmap 2026-01-25 10:40:03 -08:00
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00