mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
libthread: input sanity checks
This commit is contained in:
parent
118dfa98b8
commit
80f2165d27
1 changed files with 3 additions and 2 deletions
|
@ -96,9 +96,8 @@ altcanexec(Alt *a)
|
|||
_Altarray *ar;
|
||||
Channel *c;
|
||||
|
||||
if(a->op == CHANNOP)
|
||||
if(a->op == CHANNOP || (c=a->c) == nil)
|
||||
return 0;
|
||||
c = a->c;
|
||||
if(c->bufsize == 0){
|
||||
ar = chanarray(c, otherop(a->op));
|
||||
return ar && ar->n;
|
||||
|
@ -119,6 +118,8 @@ altqueue(Alt *a)
|
|||
{
|
||||
_Altarray *ar;
|
||||
|
||||
if(a->c == nil)
|
||||
return;
|
||||
ar = chanarray(a->c, a->op);
|
||||
addarray(ar, a);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue