aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd/acme/mail/mail.c9
-rw-r--r--src/libplumb/fid.c4
2 files changed, 10 insertions, 3 deletions
diff --git a/src/cmd/acme/mail/mail.c b/src/cmd/acme/mail/mail.c
index 14ace323..474d8497 100644
--- a/src/cmd/acme/mail/mail.c
+++ b/src/cmd/acme/mail/mail.c
@@ -84,9 +84,12 @@ threadmain(int argc, char *argv[])
quotefmtinstall();
/* open these early so we won't miss notification of new mail messages while we read mbox */
- plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC);
- plumbseemailfd = plumbopenfid("seemail", OREAD|OCEXEC);
- plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC);
+ if((plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC)) == nil)
+ fprint(2, "warning: open plumb/send: %r\n");
+ if((plumbseemailfd = plumbopenfid("seemail", OREAD|OCEXEC)) == nil)
+ fprint(2, "warning: open plumb/seemail: %r\n");
+ if((plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC)) == nil)
+ fprint(2, "warning: open plumb/showmail: %r\n");
shortmenu = 0;
srvname = "mail";
diff --git a/src/libplumb/fid.c b/src/libplumb/fid.c
index ec133c82..017f92c3 100644
--- a/src/libplumb/fid.c
+++ b/src/libplumb/fid.c
@@ -138,6 +138,10 @@ plumbrecvfid(CFid *fid)
Plumbmsg *m;
int n, more;
+ if(fid == nil){
+ werrstr("invalid fid");
+ return nil;
+ }
buf = malloc(8192);
if(buf == nil)
return nil;