; Safer 'x-display-monitor-attributes-list'

* src/xfns.c (Fx_display_monitor_attributes_list): Don't access
more elements in monitor_frames than there are monitors reported
by 'gdk_display_get_n_monitors' or 'gdk_screen_get_n_monitors'.
(Bug#79941)
This commit is contained in:
Eli Zaretskii 2026-01-24 12:54:30 +02:00
parent aa352804af
commit f1b3343e3d

View file

@ -6648,7 +6648,8 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
#else
i = gdk_screen_get_monitor_at_window (gscreen, gwin);
#endif
ASET (monitor_frames, i, Fcons (frame, AREF (monitor_frames, i)));
if (0 <= i && i < n_monitors)
ASET (monitor_frames, i, Fcons (frame, AREF (monitor_frames, i)));
}
}