Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compctl crash



On Apr 18,  5:01pm, Nicholas Riley wrote:
}
} I misunderstood the documentation for compctl, so I tried this:
} 
} compctl +
} 
} This crashes zsh back to at least 4.3.9 and up to the current version in 
} Git.  I had thought it would reset all the compctl-defined completions.

No, it's just supposed to list all the completions, like "compctl" with
no arguments at all.

There is indeed a double free.  There are only two calls to get_compctl()
in the source, and as far as I can tell neither of them really wants to
have it free an object passed in by the caller.  The value of "cl" is
always false, too, so there's a lot of dead code here.

diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 0143370..ab1857c 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -398,7 +398,6 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl)
 	if (cl)
 	    return 1;
 	else {
-	    freecompctl(cc);
 	    cclist = COMP_REMOVE;
 	    return 0;
 	}



Messages sorted by: Reverse Date, Date, Thread, Author