summaryrefslogtreecommitdiff
path: root/bin/ksh/var.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2013-12-18 13:53:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2013-12-18 13:53:13 +0000
commit5b0ac1ba4a8753cf1e24d0650976e2e242f5880d (patch)
treed265b515011e6d65619ebfb3c83c03e93be88648 /bin/ksh/var.c
parent4e4eb732af8c5c97b245c8a92cfc8234ac693456 (diff)
Remove artificial limit on the max array index.
Adapted from a bitrig commit from Martin Natano. OK zhuk@
Diffstat (limited to 'bin/ksh/var.c')
-rw-r--r--bin/ksh/var.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index ac2bf76b875..210181d5017 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.36 2013/12/17 16:37:06 deraadt Exp $ */
+/* $OpenBSD: var.c,v 1.37 2013/12/18 13:53:12 millert Exp $ */
#include "sh.h"
#include <time.h>
@@ -142,7 +142,7 @@ array_index_calc(const char *n, bool *arrayp, int *valp)
afree(tmp, ATEMP);
n = str_nsave(n, p - n, ATEMP);
evaluate(sub, &rval, KSH_UNWIND_ERROR, true);
- if (rval < 0 || rval > ARRAYMAX)
+ if (rval < 0 || rval > INT_MAX)
errorf("%s: subscript %ld out of range", n, rval);
*valp = rval;
afree(sub, ATEMP);