From 9888ead0425a9acc90853cd865b3a131534544fe Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 25 Jan 2013 14:19:18 +0100 Subject: libventi: handle nil connection in rpc as error instead of crashing (from sources) --- sys/src/libventi/rpc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/src/libventi/rpc.c b/sys/src/libventi/rpc.c index 5a820a995..f2ddd91a6 100644 --- a/sys/src/libventi/rpc.c +++ b/sys/src/libventi/rpc.c @@ -37,6 +37,13 @@ _vtrpc(VtConn *z, Packet *p, VtFcall *tx) uchar tag, buf[2], *top; Rwait *r, *rr; + + if(z == nil){ + werrstr("not connected"); + packetfree(p); + return nil; + } + /* must malloc because stack could be private */ r = vtmallocz(sizeof(Rwait)); -- cgit v1.2.3