]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nctgpio(4): Don't index past the end of sc->pins array
authorcem <cem@FreeBSD.org>
Wed, 20 Apr 2016 01:17:18 +0000 (01:17 +0000)
committercem <cem@FreeBSD.org>
Wed, 20 Apr 2016 01:17:18 +0000 (01:17 +0000)
commita83d88847ec6776630c3b69efb8c6dcc2960f1bc
treea0e18543d1a7f2c19afaceb34d90d83ddc89ad99
parent74adfc723aa909658e6ca53425f294ca0782764e
nctgpio(4): Don't index past the end of sc->pins array

This driver thinks that the NCT_MAX_PIN index is a valid index in a few places
(nct_attach() for-loop, as well as NCT_IS_VALID_PIN()).  Allocate room for
NCT_MAX_PIN as an index, that is, NCT_MAX_PIN + 1 elements.

Reported by: Coverity
CIDs: 13538061353807135380813538091353810
Sponsored by: EMC / Isilon Storage Division
sys/dev/nctgpio/nctgpio.c