Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fix seg fault after recursive-edit
- X-seq: zsh-workers 32448
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: fix seg fault after recursive-edit
- Date: Sat, 01 Mar 2014 00:52:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1393631528; bh=9loSYL7Kpn6YxAsqU5NwUZWjdBOuWwqWidH5zBDgeTI=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:From:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=mcXQSsXWpeGto+wqsHZyGRGGBRbqcD04qrFJP5zMhUBBelehDp4j63jLgVN3WimTLp/EtfeSGoTGj2xIzxhTLx9BQ0Ao7b7QfQRNH/0jKe3fBP9BplAe8iYhG1g0cFjdh+u+VcOHf34j035FOlrVlnVCRT2zY7XfACSppDXLaZE=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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 : "";
}
/**/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author