zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Maxime de Roucy <maxime.deroucy@gmail.com>, zsh-workers@zsh.org
Subject: Re: [PATCH] Fix complist menuselect segmentation fault
Date: Mon, 03 Jul 2017 15:25:20 +0100	[thread overview]
Message-ID: <20170703152520.73b1e002@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20170702145820.14588-1-maxime.deroucy@gmail.com>

On Sun,  2 Jul 2017 16:58:20 +0200
Maxime de Roucy <maxime.deroucy@gmail.com> wrote:
> Without this patch :
> 
> I use :
> 
>   zstyle ':completion:*:hosts' menu yes=long yes=20 select search
> 
> Imagine I have 2 hosts : "ab" and "bb"
> 
> When I try to use the completion menu ("isearch") and type "aa" the shell
> crash (segmentation fault).
> 
> The first "a" match only host "ab", so when a type the second "a", mcol
> and mline == 0.
> 
> The first time the code enter "if (x == ex && y == ey)", it leave the if
> with x = y = ex = ey = 0.
> Then "++x" (line 2331) increment x, and x and y can't match ex and ey
> anymore since they can only increase.
> → segmentation fault

Thanks --- the existing code here is obscure enough I think I'm just
going to apply your patch and see if anyone notices side effects.  It
looks like they'd have to be pretty subtle --- I'm guessing that
problem has been there a very long time.

pws


  reply	other threads:[~2017-07-03 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170702150008epcas3p3213f071ddf0b458c37812d0cb3ee03aa@epcas3p3.samsung.com>
2017-07-02 14:58 ` Maxime de Roucy
2017-07-03 14:25   ` Peter Stephenson [this message]
2017-07-04  9:14   ` Sebastian Gniazdowski
2017-07-04 11:40     ` Maxime de Roucy
2017-07-04 12:24       ` Sebastian Gniazdowski

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=20170703152520.73b1e002@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=maxime.deroucy@gmail.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).