mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
libplumb, Mail: fix crash on nil plumb fids
http://codereview.appspot.com/116083
This commit is contained in:
parent
0cadb4301d
commit
7b5db1c35a
2 changed files with 10 additions and 3 deletions
|
@ -84,9 +84,12 @@ threadmain(int argc, char *argv[])
|
||||||
quotefmtinstall();
|
quotefmtinstall();
|
||||||
|
|
||||||
/* open these early so we won't miss notification of new mail messages while we read mbox */
|
/* open these early so we won't miss notification of new mail messages while we read mbox */
|
||||||
plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC);
|
if((plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC)) == nil)
|
||||||
plumbseemailfd = plumbopenfid("seemail", OREAD|OCEXEC);
|
fprint(2, "warning: open plumb/send: %r\n");
|
||||||
plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC);
|
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;
|
shortmenu = 0;
|
||||||
srvname = "mail";
|
srvname = "mail";
|
||||||
|
|
|
@ -138,6 +138,10 @@ plumbrecvfid(CFid *fid)
|
||||||
Plumbmsg *m;
|
Plumbmsg *m;
|
||||||
int n, more;
|
int n, more;
|
||||||
|
|
||||||
|
if(fid == nil){
|
||||||
|
werrstr("invalid fid");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
buf = malloc(8192);
|
buf = malloc(8192);
|
||||||
if(buf == nil)
|
if(buf == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
Loading…
Reference in a new issue