diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-25 14:19:18 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-25 14:19:18 +0100 |
commit | 9888ead0425a9acc90853cd865b3a131534544fe (patch) | |
tree | e7775178ef4be58aed820fdf20fc443e9d652b89 /sys/src/libventi | |
parent | 0c4d5b8b07088ca818e786d08f0ae54a6c1d60df (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.c | 7 |
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)); |