hw/rdma: Fix possible out of bounds access to regs array
commit350929172b0205dccf19c29b93ac41a406ef740d
authorYuval Shaia <yuval.shaia@oracle.com>
Mon, 30 Apr 2018 20:02:21 +0000 (30 23:02 +0300)
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
Thu, 3 May 2018 17:52:29 +0000 (3 20:52 +0300)
treee3217a41ff7a9cd6695aed32177d9c999b2d6a61
parentc387e8a4ecee76479f4b83b58e2e8ab854ef74ee
hw/rdma: Fix possible out of bounds access to regs array

Coverity (CID1390589, CID1390608).
Array size is RDMA_BAR1_REGS_SIZE, let's make sure the given address is
in range.

While there also:
1. Adjust the size of this bar to reasonable size
2. Report the size of the array with sizeof(array)

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <20180430200223.4119-6-marcel.apfelbaum@gmail.com>
hw/rdma/vmw/pvrdma.h
hw/rdma/vmw/pvrdma_main.c