diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2022-04-11 23:26:57 +0200 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2022-04-11 23:31:11 +0200 |
commit | 1039b09c0c897731b2fbd8b1fb14bf6155007ab5 (patch) | |
tree | 75c0a189b7cc1a65ce0862251dd3075abd301421 /Src/Zle/compcore.c | |
parent | 35ff1e271a488e480ff2c4ca73f67707b727e6d8 (diff) | |
download | zsh-1039b09c0c897731b2fbd8b1fb14bf6155007ab5.tar.gz zsh-1039b09c0c897731b2fbd8b1fb14bf6155007ab5.tar.xz zsh-1039b09c0c897731b2fbd8b1fb14bf6155007ab5.zip |
50042: Another fix for 49915
If the last element in the list is a duplicate, we would walk off the end
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r-- | Src/Zle/compcore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index fe3ea10fc..4ac5d089f 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -3314,7 +3314,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp) if (del) { int n_orig = n; for (bp = rp, ap = rp; bp < rp + n_orig; ap++, bp++) { - while (bp[0]->flags & CMF_DELETE) { + while (bp < rp + n_orig && (bp[0]->flags & CMF_DELETE)) { bp++; n--; } |