summaryrefslogtreecommitdiff
path: root/tests/vb21_api_tests.c
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-08-13 14:25:20 -0600
committerCommit Bot <commit-bot@chromium.org>2019-08-16 04:13:20 +0000
commit445e371ebc7afaca6be293f43055eae0fbeb67be (patch)
treeef130b3e82a6bb28b6f02f149ccaae24b8ba63c0 /tests/vb21_api_tests.c
parent26c3f19073bac4c01fdbf4e3417e341d235f60ab (diff)
downloadvboot-445e371ebc7afaca6be293f43055eae0fbeb67be.tar.gz
tests: Fix off-by-one error in array bounds check
rptr points to an object with rsize number of bytes. If offset + size == rsize, then rptr + offset + size will point to one byte past the end of the object during the memcpy(). Exclude this case by adding it to the bounds check. We can also remove the offset > rsize check since it is subsumed in the other one. BUG=none TEST=make clean && make runtests BRANCH=none Change-Id: Iceda658f420babe61bd1d9807efc8333d2044ccc Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 198905 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1752766 Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'tests/vb21_api_tests.c')
0 files changed, 0 insertions, 0 deletions