diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2026-05-19 09:09:21 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2026-05-19 11:54:26 -0700 |
| commit | 2dbfed05322bde0703c2a8a841c8a90174120454 (patch) | |
| tree | 4f6924de1c4a795335e0b3cac0ec7d0cb00b7a87 | |
| parent | fe33900747e4260c698508fc43e8c4391fa5c53a (diff) | |
display_tty_menu_item eassert for absurdly long item texts
* src/xdisp.c (display_tty_menu_item): Add an eassert.
| -rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c1d6fedb553..b00a4b2e1e7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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) |
