1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-20 18:17:20 +00:00

Avoid crashes due to invalid 'mode-line-format'

* src/xdisp.c (display_mode_element, redisplay_window_error):
Don't take XCAR of what can be Qnil.  (Bug#64893)

(cherry picked from commit 7ea3f39dee)
This commit is contained in:
Eli Zaretskii 2023-07-27 15:34:38 +03:00
parent b2cb6e8216
commit 71419a60c3

View File

@ -17601,6 +17601,7 @@ redisplay_window_error (Lisp_Object error_data)
if (max_redisplay_ticks > 0 if (max_redisplay_ticks > 0
&& CONSP (error_data) && CONSP (error_data)
&& EQ (XCAR (error_data), Qerror) && EQ (XCAR (error_data), Qerror)
&& CONSP (XCDR (error_data))
&& STRINGP (XCAR (XCDR (error_data)))) && STRINGP (XCAR (XCDR (error_data))))
Vdelayed_warnings_list = Fcons (list2 (XCAR (error_data), Vdelayed_warnings_list = Fcons (list2 (XCAR (error_data),
XCAR (XCDR (error_data))), XCAR (XCDR (error_data))),
@ -27091,7 +27092,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
oprops = Fcopy_sequence (oprops); oprops = Fcopy_sequence (oprops);
tem = props; tem = props;
while (CONSP (tem)) while (CONSP (tem) && CONSP (XCDR (tem)))
{ {
oprops = plist_put (oprops, XCAR (tem), oprops = plist_put (oprops, XCAR (tem),
XCAR (XCDR (tem))); XCAR (XCDR (tem)));