aboutsummaryrefslogtreecommitdiff
path: root/src/libplumb
diff options
context:
space:
mode:
Diffstat (limited to 'src/libplumb')
-rwxr-xr-xsrc/libplumb/mesg.c8
1 files changed, 8 insertions, 0 deletions
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;