summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2005-03-07 09:29:21 +0000
committerKim F. Storm <storm@cua.dk>2005-03-07 09:29:21 +0000
commit2e87e8f20728c38be7028765178c721c384109fd (patch)
tree6a332a26668912258a01e853de61b98919f61986 /src/xdisp.c
parentf30c4a5ca38129745efad61cfc9245167a8319ef (diff)
downloademacs-2e87e8f20728c38be7028765178c721c384109fd.tar.gz
(notice_overwritten_cursor): Check that phys_cursor.vpos
is valid. If not, clear phys_cursor_on_p and return.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 71fca1b5eec..16b626959c6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20201,9 +20201,14 @@ notice_overwritten_cursor (w, area, x0, x1, y0, y1)
if (area != TEXT_AREA)
return;
- row = w->current_matrix->rows + w->phys_cursor.vpos;
- if (!row->displays_text_p)
- return;
+ if (w->phys_cursor.vpos < 0
+ || w->phys_cursor.vpos >= w->current_matrix->nrows
+ || (row = w->current_matrix->rows + w->phys_cursor.vpos,
+ !(row->enabled_p && row->displays_text_p)))
+ {
+ w->phys_cursor_on_p = 0;
+ return;
+ }
if (row->cursor_in_fringe_p)
{