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

Re: [hamer@xxxxxxxxxxxx: Bug#590736: zsh: Segmentation fault in completion]



On Thu, 29 Jul 2010 04:48:58 +0000
ÐÐÐÐÑÐÐÐÑ ÐÐÐÐÑÐÐÐÐ <hamer@xxxxxxxxxxxx> 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@xxxxxxx>            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



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