display_tty_menu_item eassert for absurdly long item texts

* src/xdisp.c (display_tty_menu_item): Add an eassert.
This commit is contained in:
Paul Eggert 2026-05-19 09:09:21 -07:00
parent fe33900747
commit 2dbfed0532

View file

@ -27922,6 +27922,11 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
struct glyph_row *row;
size_t item_len = strlen (item_text);
/* FIXME: callers do not seem to guarantee that the length is sane.
If it gets close to or greater than INT_MAX, things will go squirrelly.
Also, shouldn't this use menu_item_width rather than strlen? */
eassert (item_len <= INT_MAX / 2);
struct frame *rf = NULL;
if (FRAME_PARENT_FRAME (f) && !FRAME_WINDOW_P (f)