]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r341526:
authorHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 12 Dec 2018 10:28:50 +0000 (10:28 +0000)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 12 Dec 2018 10:28:50 +0000 (10:28 +0000)
commit77d7dc68cbe4d4d2480a072d819c9da1751dff72
tree034d3647b3e9b37d2c071b37c06f1bfeebad1b4a
parent576f9d77e6cd215ff6117add550b0461fb384848
MFC r341526:
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

Sponsored by:   Mellanox Technologies
sys/ofed/drivers/infiniband/core/ib_mad.c