aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libventi/client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libventi/client.c b/src/libventi/client.c
index 9f200f48..f76fd343 100644
--- a/src/libventi/client.c
+++ b/src/libventi/client.c
@@ -65,6 +65,11 @@ vtreadpacket(VtConn *z, uchar score[VtScoreSize], uint type, int n)
if(memcmp(score, vtzeroscore, VtScoreSize) == 0)
return packetalloc();
+ if(z == nil){
+ werrstr("not connected");
+ return nil;
+ }
+
if(z->version[1] == '2' && n >= (1<<16)) {
werrstr("read count too large for protocol");
return nil;