summaryrefslogtreecommitdiff
path: root/sys/src/libventi
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-25 14:19:18 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-25 14:19:18 +0100
commit9888ead0425a9acc90853cd865b3a131534544fe (patch)
treee7775178ef4be58aed820fdf20fc443e9d652b89 /sys/src/libventi
parent0c4d5b8b07088ca818e786d08f0ae54a6c1d60df (diff)
libventi: handle nil connection in rpc as error instead of crashing (from sources)
Diffstat (limited to 'sys/src/libventi')
-rw-r--r--sys/src/libventi/rpc.c7
1 files changed, 7 insertions, 0 deletions
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));