summaryrefslogtreecommitdiff
path: root/sys/src/9/ip
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-05-05 18:54:58 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-05-05 18:54:58 +0200
commit66719fb3ea15351f8860cc6696993357a60ab238 (patch)
tree83e865384531ef9557bd5faf5be4d31d9592e08b /sys/src/9/ip
parent7d45ee4f6adc378fb6244c73abe8e46fe636beae (diff)
kernel: fix cb->f[0] nil dereferences due to short control request
Diffstat (limited to 'sys/src/9/ip')
-rw-r--r--sys/src/9/ip/iproute.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/9/ip/iproute.c b/sys/src/9/ip/iproute.c
index 53e3da988..518950309 100644
--- a/sys/src/9/ip/iproute.c
+++ b/sys/src/9/ip/iproute.c
@@ -797,7 +797,8 @@ routewrite(Fs *f, Chan *c, char *p, int n)
free(cb);
nexterror();
}
-
+ if(cb->nf < 1)
+ error("short control request");
if(strcmp(cb->f[0], "flush") == 0){
tag = cb->f[1];
for(h = 0; h < nelem(f->v4root); h++)
@@ -846,7 +847,8 @@ routewrite(Fs *f, Chan *c, char *p, int n)
na = newipaux(a->owner, cb->f[1]);
c->aux = na;
free(a);
- }
+ } else
+ error(Ebadctl);
poperror();
free(cb);