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

PATCH: fix seg fault after recursive-edit



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