summaryrefslogtreecommitdiff
path: root/pez.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-04-14 10:58:30 +0200
committerlemon <lsof@mailbox.org>2025-04-14 10:58:30 +0200
commita74d1a93205f540806596aeb0eb7cfa8d3ee2dc1 (patch)
tree175c43ff4a20c8d665a8cf822a95fafa84c809dd /pez.c
parentae4c0b047ab46addeccdbab828fb81a766db5db3 (diff)
fix negative index out of bounds
Diffstat (limited to 'pez.c')
-rw-r--r--pez.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pez.c b/pez.c
index 4b841dd..30735a2 100644
--- a/pez.c
+++ b/pez.c
@@ -1435,7 +1435,7 @@ checkindex(PezContext *cx, int *idx, Fn *srcfn, int srcpc, const char *what, int
}
*idx = fixtoint(num);
*idx = *idx < 0 ? len + *idx : *idx;
- if (*idx >= len) {
+ if ((uint) *idx >= len) {
return runerr(cx, srcfn, srcpc, "%s index out of range", what), 0;
}
return 1;