From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: fix seg fault after recursive-edit
Date: Sat, 01 Mar 2014 00:52:06 +0100 [thread overview]
Message-ID: <946.1393631526@thecus.kiddle.eu> (raw)
In a zle widget, I test $WIDGET after returning from recursive-edit (via
narrow-to-region). If I had interrupted the recursive-edit with Ctrl-C,
this results in a seg fault due to a null pointer dereference.
The following is a fix.
Oliver
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index a9bbf13..5845207 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -363,7 +363,7 @@ get_prebuffer(UNUSED(Param pm))
static char *
get_widget(UNUSED(Param pm))
{
- return bindk->nam;
+ return bindk ? bindk->nam : "";
}
/**/
reply other threads:[~2014-02-28 23:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=946.1393631526@thecus.kiddle.eu \
--to=okiddle@yahoo.co.uk \
--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).