aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2023-01-15 02:46:28 +0100
committerJulian Hurst <ark@mansus.space>2023-01-15 02:46:28 +0100
commit85e011deb24572621803080cfbb9e787f1300775 (patch)
tree44af86827d4d5046cd30d22643f3797f38cbd193
parent3886b3a61205be2ba9654061793f94896f6761f5 (diff)
downloaddocspace-85e011deb24572621803080cfbb9e787f1300775.tar.gz
Fix slice bounds out of range when nb of images < pagesize
-rw-r--r--imgs.go3
1 files changed, 3 insertions, 0 deletions
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