shithub: vim

Download patch

ref: 920685146057a91a66a5c00ecd6362edf5f9b3fc
parent: 9bc180134a6a2c2943f33f84a0d1b7aa9bf0072d
author: phil9 <telephil9@gmail.com>
date: Wed Sep 13 04:22:22 EDT 2023

fix vim crashing when plumber is not running

	it seems we are receiving plumb events even with the plumber not running.
	This lead to vim crashing because the event is nil and we try to use it anyway.

--- a/os_plan9.c
+++ b/os_plan9.c
@@ -89,6 +89,8 @@
     while(ecanread(plumbkey)){
 	eread(plumbkey, &e);
 	m = e.v;
+	if(m == nil)
+		return;
 	addr = plumblookup(m->attr, "addr");
 	if(addr)
 		l = atoi(addr);
@@ -1058,7 +1060,8 @@
     /* Mouse events must be enabled to receive window resizes. */
     einit(Emouse | Ekeyboard);
     plumbkey = eplumb(512, "edit");
-    start_plumber_thread();
+    if(plumbkey >= 0)
+	    start_plumber_thread();
     scr_inited = TRUE;
 }