From 01669ad9a67af27101decc387e44407e0a08bcf2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 4 Oct 2016 22:12:08 +0300 Subject: [PATCH] Avoid crashes when setting the cursor * src/xdisp.c (display_and_set_cursor): Don't index glyphs of a glyph row if hpos is out of valid bounds. This avoids crashes in some rare cases. (Bug#24614) --- src/xdisp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index adbb6e5088b..42c6fb75efa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28486,8 +28486,7 @@ display_and_set_cursor (struct window *w, bool on, } glyph = NULL; - if (!glyph_row->exact_window_width_line_p - || (0 <= hpos && hpos < glyph_row->used[TEXT_AREA])) + if (0 <= hpos && hpos < glyph_row->used[TEXT_AREA]) glyph = glyph_row->glyphs[TEXT_AREA] + hpos; eassert (input_blocked_p ()); -- 2.39.2