summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-12-06 10:17:45 +1100
committerCommit Bot <commit-bot@chromium.org>2019-12-10 02:24:14 +0000
commitf21572c7187c8beb9c6bfea6446351ae93200d01 (patch)
tree019623d7ddec73324d741a3b902591c08d77e8fe /tests
parentaa77ea40454c460a7189860f1ea146c45e444dad (diff)
downloadcrosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar.gz
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar.bz2
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar.lz
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar.xz
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.tar.zst
crosvm-f21572c7187c8beb9c6bfea6446351ae93200d01.zip
qcow: avoid out-of-bounds access in alloc_refblocks
When all refblocks are consumed, the loop looking for the first free
cluster would access the element at refcounts[refcounts.len()], which is
out of bounds.  Modify the free cluster search loop to check that the
index is in bounds before accessing it.

BUG=chromium:1030751
TEST=qcow_fuzzer

Change-Id: Ib2384b9cf1edeaadb99be5fc67c27a55c03fc6e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1953766
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions