]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r341526:
authorhselasky <hselasky@FreeBSD.org>
Wed, 12 Dec 2018 10:29:48 +0000 (10:29 +0000)
committerhselasky <hselasky@FreeBSD.org>
Wed, 12 Dec 2018 10:29:48 +0000 (10:29 +0000)
commitde037aba6690448a87cdfb0452cc7df39da18eb5
tree0dba9dea1e5c2b449adeb228f46f132bd8add71e
parent9a4f29ad1d12ef832f2ec6ba34a6f656499f4bbe
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