From 347418e75aa49014e2d2f4c635eb72646eafd5f9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 31 Dec 2023 13:37:49 +0000 Subject: [PATCH] File draw method: add a missing bounds check. Don't try to render an item that doesn't even exist at all. --- src/file.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/file.rs b/src/file.rs index 2dcabf6..ae2427d 100644 --- a/src/file.rs +++ b/src/file.rs @@ -354,6 +354,7 @@ impl ActivityState for FeedFile { // Retrieve rendered lines from the bottom of the window upwards 'outer: while item >= self.contents.first_index() && + item < self.contents.index_limit() && lines.len() + 1 < h { let rendered = self.rendered.get(&item) -- 2.30.2