From 78802e6993a0f44d7ac7ff7d0922d55d1b089dac Mon Sep 17 00:00:00 2001 From: rsc Date: Sat, 24 Apr 2004 04:52:49 +0000 Subject: various bug fixes --- src/libplumb/mesg.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libplumb') diff --git a/src/libplumb/mesg.c b/src/libplumb/mesg.c index 4b278695..670059ca 100755 --- a/src/libplumb/mesg.c +++ b/src/libplumb/mesg.c @@ -64,6 +64,10 @@ plumbsendtofid(Fid *fid, Plumbmsg *m) char *buf; int n; + if(fid == nil){ + werrstr("invalid fid"); + return -1; + } buf = plumbpack(m, &n); if(buf == nil) return -1; @@ -75,6 +79,10 @@ plumbsendtofid(Fid *fid, Plumbmsg *m) int plumbsend(int fd, Plumbmsg *m) { + if(fd == -1){ + werrstr("invalid fd"); + return -1; + } if(fd != pfd){ werrstr("fd is not the plumber"); return -1; -- cgit v1.2.3