zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: compctl crash
Date: Thu, 18 Apr 2013 16:59:36 -0700	[thread overview]
Message-ID: <130418165936.ZM8756@torch.brasslantern.com> (raw)
In-Reply-To: <njriley-D7F989.17013218042013@news.gmane.org>

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;
 	}


  parent reply	other threads:[~2013-04-18 23:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 22:01 Nicholas Riley
2013-04-18 23:03 ` Frank Terbeck
2013-04-18 23:09   ` Nicholas Riley
2013-04-18 23:59 ` Bart Schaefer [this message]
2013-04-20 19:44   ` Nicholas Riley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=130418165936.ZM8756@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).