From 9561d8d0fd0a134e6dbdd463b4d0f3924e5a0a61 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 20 Aug 2007 09:01:49 +0200 Subject: [PATCH] move-link-up-line: segfault when cursor was below last line. (cherry picked from commit c646c860cdb4ba641bd36f0469b752fec93962fd) --- src/viewer/text/view.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 696c16a7c..4babc0379 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -616,6 +616,7 @@ move_link_up_line(struct session *ses, struct document_view *doc_view) min_y = vs->y - box->height; int_lower_bound(&min_y, 0); y1 = y = vs->y + ses->tab->y - box->y; + int_upper_bound(&y, document->height - 1); for (y--; y >= min_y; y--) { struct link *link = document->lines1[y];