From 85e011deb24572621803080cfbb9e787f1300775 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Sun, 15 Jan 2023 02:46:28 +0100 Subject: Fix slice bounds out of range when nb of images < pagesize --- imgs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgs.go b/imgs.go index ee67083..c1be6bc 100644 --- a/imgs.go +++ b/imgs.go @@ -62,6 +62,9 @@ func imgs(w http.ResponseWriter, r *http.Request) { if end > len(imgs) { end = len(imgs) } + if start > len(imgs) { + start = len(imgs) + } flasherr := consumeFlash(w, r, "error") data := struct { Imgs []Doc -- cgit v1.2.3