diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2001-05-20 09:20:46 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2001-05-20 09:20:46 +0000 |
commit | 792135ba0bcbeed157fffd425a1ae0a0c1a8b7be (patch) | |
tree | 65d05442f7c2ed9b52463b1c632bc29241cddf91 | |
parent | 6ea2dab092feb373c13a4dda85bc0d399978975a (diff) | |
download | zsh-792135ba0bcbeed157fffd425a1ae0a0c1a8b7be.tar.gz zsh-792135ba0bcbeed157fffd425a1ae0a0c1a8b7be.tar.xz zsh-792135ba0bcbeed157fffd425a1ae0a0c1a8b7be.zip |
Added some array-assignment boundary checks.
-rw-r--r-- | Src/params.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/params.c b/Src/params.c index 63e1dc75c..6c07396b2 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1727,8 +1727,13 @@ setarrvalue(Value v, char **val) v->pm->nam, 0); return; } - if (v->inv && unset(KSHARRAYS)) - v->start--, v->end--; + if (v->inv && unset(KSHARRAYS)) { + if (v->start > 0) + v->start--; + v->end--; + } + if (v->end < v->start) + v->end = v->start; q = old = v->pm->gets.afn(v->pm); n = arrlen(old); if (v->start < 0) { |