diff options
author | Russ Cox <rsc@swtch.com> | 2008-05-05 23:08:35 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-05-05 23:08:35 -0400 |
commit | 80f2165d274da5185a09ebda340505b067b08eb4 (patch) | |
tree | 24f1d15b7ae72d7c2416a4fea23b94447f81a159 /src/libthread | |
parent | 118dfa98b81785213b819f66cdb92e5a43f62326 (diff) | |
download | plan9port-80f2165d274da5185a09ebda340505b067b08eb4.tar.gz plan9port-80f2165d274da5185a09ebda340505b067b08eb4.tar.bz2 plan9port-80f2165d274da5185a09ebda340505b067b08eb4.zip |
libthread: input sanity checks
Diffstat (limited to 'src/libthread')
-rw-r--r-- | src/libthread/channel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libthread/channel.c b/src/libthread/channel.c index 080f84de..4fdf5e50 100644 --- a/src/libthread/channel.c +++ b/src/libthread/channel.c @@ -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); } |