diff options
| author | 2025-04-14 10:58:30 +0200 | |
|---|---|---|
| committer | 2025-04-14 10:58:30 +0200 | |
| commit | a74d1a93205f540806596aeb0eb7cfa8d3ee2dc1 (patch) | |
| tree | 175c43ff4a20c8d665a8cf822a95fafa84c809dd | |
| parent | ae4c0b047ab46addeccdbab828fb81a766db5db3 (diff) | |
fix negative index out of bounds
| -rw-r--r-- | pez.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |