summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-12-15 00:30:37 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-12-15 00:30:37 -0500
commit3c99618132e8f5924f7a865ce595593889000211 (patch)
tree127fd5a24f94c32b5577780e545b74c9c41f276a /src
parent31ba6a0a615c9b5d61bb335f756c7c02e701ef5e (diff)
Fix overflow with unlimited scrollback lines
Diffstat (limited to 'src')
-rw-r--r--src/vte.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vte.c b/src/vte.c
index 2824554..9ae78ec 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -13068,7 +13068,7 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
_vte_ring_next (screen->row_data));
_vte_ring_resize (screen->row_data, lines);
low = _vte_ring_delta (screen->row_data);
- high = low + lines - terminal->row_count + 1;
+ high = lines + MIN (G_MAXLONG - lines, low - terminal->row_count + 1);
screen->insert_delta = CLAMP (screen->insert_delta, low, high);
scroll_delta = CLAMP (scroll_delta, low, screen->insert_delta);
next = MIN (next, screen->insert_delta + terminal->row_count);