From: Eli Zaretskii Date: Thu, 27 Jul 2023 12:34:38 +0000 (+0300) Subject: Avoid crashes due to invalid 'mode-line-format' X-Git-Tag: emacs-29.1.90~277^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=71419a60c3710549742c2489b7fce7783ac0f65c;p=emacs.git 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 7ea3f39deec3d54914077455e70605a14eb7d200) --- diff --git a/src/xdisp.c b/src/xdisp.c index fdb4acd71bf..9cddcfeda27 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17601,6 +17601,7 @@ redisplay_window_error (Lisp_Object error_data) if (max_redisplay_ticks > 0 && CONSP (error_data) && EQ (XCAR (error_data), Qerror) + && CONSP (XCDR (error_data)) && STRINGP (XCAR (XCDR (error_data)))) Vdelayed_warnings_list = Fcons (list2 (XCAR (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); tem = props; - while (CONSP (tem)) + while (CONSP (tem) && CONSP (XCDR (tem))) { oprops = plist_put (oprops, XCAR (tem), XCAR (XCDR (tem)));