]> git.ipfire.org Git - thirdparty/iproute2.git/commit
iplink_can: Prevent overstepping array bounds
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Aug 2017 09:27:00 +0000 (11:27 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:17:00 +0000 (17:17 -0700)
commit258b7c0fa70c2d6b5f9776cc35c38c80b4ee5752
tree7ef6fb78649bbf0e802963aa81893447d3c8554f
parentd044ea3e784d1a4f0a61f306b86ce95c9a26b0b5
iplink_can: Prevent overstepping array bounds

can_state_names array contains at most CAN_STATE_MAX fields, so allowing
an index to it to be equal to that number is wrong. While here, also
make sure the array is indeed that big so nothing bad happens if
CAN_STATE_MAX ever increases.

Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/iplink_can.c