aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-10-04 22:12:08 +0300
committerEli Zaretskii2016-10-04 22:12:08 +0300
commit01669ad9a67af27101decc387e44407e0a08bcf2 (patch)
treefa36c05ab7ced7ec905b8ffe2d9cafb9c180d8c8
parentf2144eef19611fb2189c44c055e1d539b7a53f08 (diff)
downloademacs-01669ad9a67af27101decc387e44407e0a08bcf2.tar.gz
emacs-01669ad9a67af27101decc387e44407e0a08bcf2.zip
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)
-rw-r--r--src/xdisp.c3
1 files changed, 1 insertions, 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,
28486 } 28486 }
28487 28487
28488 glyph = NULL; 28488 glyph = NULL;
28489 if (!glyph_row->exact_window_width_line_p 28489 if (0 <= hpos && hpos < glyph_row->used[TEXT_AREA])
28490 || (0 <= hpos && hpos < glyph_row->used[TEXT_AREA]))
28491 glyph = glyph_row->glyphs[TEXT_AREA] + hpos; 28490 glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
28492 28491
28493 eassert (input_blocked_p ()); 28492 eassert (input_blocked_p ());