aboutsummaryrefslogtreecommitdiff
path: root/src/libventi
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2012-07-29 18:53:37 -0400
committerRuss Cox <rsc@swtch.com>2012-07-29 18:53:37 -0400
commit4ed8efea38afb72dfb0028a4470698563a4176e0 (patch)
tree98c6d0117ac72cab03059bfd9306fb6c95da839b /src/libventi
parentd2173bb552d308d60a4e4a53cd3b8e0949b38dbc (diff)
downloadplan9port-4ed8efea38afb72dfb0028a4470698563a4176e0.tar.gz
plan9port-4ed8efea38afb72dfb0028a4470698563a4176e0.tar.bz2
plan9port-4ed8efea38afb72dfb0028a4470698563a4176e0.zip
libventi: fix segfault in vtgetreq
Don't call vtlog() when _vtqrecv() returns nil on queue hangup, as reported on http://bitbucket.org/rsc/plan9port/issue/102/ R=rsc http://codereview.appspot.com/6373046
Diffstat (limited to 'src/libventi')
-rw-r--r--src/libventi/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libventi/server.c b/src/libventi/server.c
index d82be698..91752200 100644
--- a/src/libventi/server.c
+++ b/src/libventi/server.c
@@ -182,7 +182,8 @@ vtgetreq(VtSrv *srv)
VtReq *r;
r = _vtqrecv(srv->q);
- vtlog(VtServerLog, "<font size=-1>%T %s:</font> vtgetreq %F<br>\n", ((VtSconn*)r->sc)->c->addr, &r->tx);
+ if (r != nil)
+ vtlog(VtServerLog, "<font size=-1>%T %s:</font> vtgetreq %F<br>\n", ((VtSconn*)r->sc)->c->addr, &r->tx);
return r;
}