]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ibcore: Fix an array index check
authorslavash <slavash@FreeBSD.org>
Wed, 5 Dec 2018 13:20:51 +0000 (13:20 +0000)
committerslavash <slavash@FreeBSD.org>
Wed, 5 Dec 2018 13:20:51 +0000 (13:20 +0000)
commit7736259840de8ca372b17c3b55763443712c5596
tree5b0bdf8b04a0de2a81c537c7b196743f4cdafa5d
parent2d572a8cf913d0c55e9f7e5da3ec09f8fef6ee6d
ibcore: Fix an array index check

The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead
of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
reports the following:

Overrunning array class->method_table of 80 8-byte elements at element index 127
(byte offset 1016) using index convert_mgmt_class(mad_hdr->mgmt_class)
(which evaluates to 127).

Linux commit:
2fe2f378dd45847d2643638c07a7658822087836

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
sys/ofed/drivers/infiniband/core/ib_mad.c