mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +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;
|
_Altarray *ar;
|
||||||
Channel *c;
|
Channel *c;
|
||||||
|
|
||||||
if(a->op == CHANNOP)
|
if(a->op == CHANNOP || (c=a->c) == nil)
|
||||||
return 0;
|
return 0;
|
||||||
c = a->c;
|
|
||||||
if(c->bufsize == 0){
|
if(c->bufsize == 0){
|
||||||
ar = chanarray(c, otherop(a->op));
|
ar = chanarray(c, otherop(a->op));
|
||||||
return ar && ar->n;
|
return ar && ar->n;
|
||||||
|
@ -119,6 +118,8 @@ altqueue(Alt *a)
|
||||||
{
|
{
|
||||||
_Altarray *ar;
|
_Altarray *ar;
|
||||||
|
|
||||||
|
if(a->c == nil)
|
||||||
|
return;
|
||||||
ar = chanarray(a->c, a->op);
|
ar = chanarray(a->c, a->op);
|
||||||
addarray(ar, a);
|
addarray(ar, a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue