From: Eli Zaretskii Date: Tue, 4 Oct 2016 19:12:08 +0000 (+0300) Subject: Avoid crashes when setting the cursor X-Git-Tag: emacs-25.1.90~147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=01669ad;p=emacs.git 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) --- 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 ());