From ccb454f28cc09a5f9f9eddb5bb9e4b8b641c6233 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 21 Apr 2026 15:49:07 +0300 Subject: [PATCH] Fix unsafe use of SDATA in 'display_tty_menu_separator' * src/xdisp.c (display_tty_menu_separator): Pass Lisp string to display_string, not a pointer to its SDATA. This is safer GC-wise. --- src/xdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 281f04e4132..a05e5bda48a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27765,7 +27765,7 @@ display_tty_menu_separator (struct it *it, const char *label, int width) else c = display_tty_menu_separator_char ('-', BOX_HORIZONTAL); Lisp_Object sep = Fmake_string (make_fixnum (width - 1), make_fixnum (c), Qt); - display_string ((char *) SDATA (sep), Qnil, Qnil, 0, 0, it, width, -1, -1, 1); + display_string ((char *) SDATA (sep), sep, Qnil, 0, 0, it, width, -1, -1, 1); } /* Display one menu item on a TTY, by overwriting the glyphs in the