Fixes unchecked results from parsecmd
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Mar 2015 15:00:20 +0000 (10:00 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Mar 2015 15:00:20 +0000 (10:00 -0500)
commit45749fce969c06556fce0e061f3156e5e352996d
treefc50075cbfeb9f0ba7cb7af0bab05514e6a0feaa
parent0d140d5b8e17951f9732dd05d1f483e910db20b1
Fixes unchecked results from parsecmd

Before accessing the strings of a parsecmd, we must check the nf (num
fields).  Many devices were not checking, so something like
echo "" > /net/ether0/stats
Would trigger a PF.

Using lookupcmd() is safe, since it check the nf internally.  But any
naked access to the fields (like with strcmp) requires a check.
kern/drivers/dev/alarm.c
kern/drivers/dev/ether.c
kern/drivers/dev/nix.c
kern/drivers/dev/vm.c
kern/drivers/net/bnx2x/bnx2x_dev.c
kern/src/net/iproute.c