xserver/dri3
Alan Coopersmith f05f269f1d 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>
2025-11-01 21:55:42 +00:00
..
dri3.c rename old symbol PANORAMIX to XINERAMA 2025-02-06 15:51:27 +00:00
dri3.h DRI3: add DRI3ImportSyncobj and DRI3FreeSyncobj 2024-04-09 06:11:03 +00:00
dri3_priv.h DRI3: add DRI3ImportSyncobj and DRI3FreeSyncobj 2024-04-09 06:11:03 +00:00
dri3_request.c Revert "dri3: use dixDestroyPixmap() instead of direct driver call" 2025-06-17 20:02:16 +00:00
dri3_screen.c dri: prevent out-of-bounds read in dri3_fd_from_pixmap 2025-11-01 21:55:42 +00:00
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00