zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: zsh-workers@zsh.org
Subject: Re: [hamer@hamer.org.ua: Bug#590736: zsh: Segmentation fault in completion]
Date: Thu, 29 Jul 2010 10:07:37 +0100	[thread overview]
Message-ID: <20100729100737.20053174@csr.com> (raw)
In-Reply-To: <20100729044858.GA360@scru.org>

On Thu, 29 Jul 2010 04:48:58 +0000
Александр Новиченко <hamer@hamer.org.ua> wrote:
> As you can see, problem is in spelling NULL-pointer in matcheq().
> 
> For resolving ths bug, i propose use this patch:
> 
> diff -Naur zsh-4.3.10.orig/Src/Zle/compcore.c
> zsh-4.3.10/Src/Zle/compcore.c --- zsh-4.3.10.orig/Src/Zle/compcore.c
> 2009-01-13 12:15:38.000000000 +0000 +++
> zsh-4.3.10/Src/Zle/compcore.c       2010-07-27 22:58:40.726692827
> +0000 @@ -2932,7 +2932,7 @@ comp_setunset(0, 0, CP_EXACTSTR, 0);
>             }
>             ai->exactm = cm;
> -       } else if (useexact && !matcheq(cm, ai->exactm)) {
> +       } else if (useexact && (!ai->exactm || !matcheq(cm, ai->exactm))) {
>             ai->exact = 2;
>             ai->exactm = NULL;
>             if (incompfunc)  

Thanks, that looks entirely reasonable.  It's clear from the code just
below that ai->exactm can be NULL when ai->exact is non-zero, which appears
to violate the assumption behind the previous code.  Given it's a week's
work to understand the completion code in enough detail to test the
assumptions any further, I'll leave it at that.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


      reply	other threads:[~2010-07-29  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29  4:48 Clint Adams
2010-07-29  9:07 ` Peter Stephenson [this message]

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=20100729100737.20053174@csr.com \
    --to=peter.stephenson@csr.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).