zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Crash when accessing WIDGETSTYLE from SIGINT trap
Date: Mon, 11 Nov 2019 15:46:23 +0000	[thread overview]
Message-ID: <1573487183.4561.11.camel@samsung.com> (raw)
In-Reply-To: <CAN=4vMp55vKoDiFDD4kijNc_xBJLve6GUifTQJVfCEecadyMCA@mail.gmail.com>

On Mon, 2019-11-11 at 16:40 +0100, Roman Perepelitsa wrote:
> On Mon, Nov 11, 2019 at 3:58 PM Peter Stephenson
> <p.stephenson@samsung.com> wrote:
> > 
> > 
> > On Mon, 2019-11-11 at 15:38 +0100, Roman Perepelitsa wrote:
> > > 
> > > Crash at zle_params.c:436 due to bindk being null:
> > > 
> > >     Widget widget = bindk->widget;
> > Looks to me like returning the empty string in that case would be fine?
> I don't know. I haven't sent a patch because I'm not sure whether the
> fix should be right there in get_widgetstyle or somewhere earlier so
> that bindk is not null to begin with.

I think there are highly likely to be such cases.  Look in zlecore()
where bindk is set.  We test for bindk NULL there after reading it.
You've got an asynchronous event so you don't know where that's going to
happen.  (There's a good chance signals are actually blocked at *that*
point, I didn't follow that through, but this is just an example.)

The only alternative I can think of would be queuing signals in more
places, but that's quite a heavyweight change that requires a good deal
of thinking through.  I think a NULL check in both places is entirely
unobjectionable.

(That doesn't mean everything else is *ncessarily* great, obviously...)

pws


  reply	other threads:[~2019-11-11 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191111143952eucas1p2784d9821f292f2c9c136b19da5a56ade@eucas1p2.samsung.com>
2019-11-11 14:38 ` Roman Perepelitsa
2019-11-11 14:58   ` Peter Stephenson
2019-11-11 15:37     ` Daniel Shahaf
2019-11-11 15:40     ` Roman Perepelitsa
2019-11-11 15:46       ` Peter Stephenson [this message]
2019-11-12 14:56       ` Mikael Magnusson
2019-11-13 16:11         ` Roman Perepelitsa

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=1573487183.4561.11.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=roman.perepelitsa@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).