vc/cavium/bdk/libdram: Add array bounds check
commit9f378d3b0395b2e7b5a8972cf69f1c6fdcabfe09
authorJacob Garber <jgarber1@ualberta.ca>
Fri, 26 Jul 2019 21:20:47 +0000 (26 15:20 -0600)
committerPatrick Georgi <pgeorgi@google.com>
Tue, 30 Jul 2019 09:55:55 +0000 (30 09:55 +0000)
tree779f31f487ccdee8e4a51d13393f19161ae9a8bc
parentc1e9ba8c3d03cb3656237c0e126b35bea548d5cc
vc/cavium/bdk/libdram: Add array bounds check

Ensure that best_en_idx is within bounds before accessing the _en array.

Change-Id: Ifa6259e28875a8cf8199896bda7982370ccaa277
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1393971
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34593
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/vendorcode/cavium/bdk/libdram/lib_octeon_shared.c