zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Another fix for 49915
@ 2022-04-11 21:29 Mikael Magnusson
  0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2022-04-11 21:29 UTC (permalink / raw)
  To: zsh-workers

If the last element in the list is a duplicate, we would walk off the end
---
Found this one while using _history-complete-older. Hopefully that's
the last bug I added in this code.

 Src/Zle/compcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index fe3ea10fca..4ac5d089f0 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--;
 			}
-- 
2.15.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-11 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 21:29 PATCH: Another fix for 49915 Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).