Skip to content
Commit 57248587 authored by Max Reitz's avatar Max Reitz Committed by Michael Roth
Browse files

qcow2: Do not overflow when writing an L1 sector



While writing an L1 table sector, qcow2_write_l1_entry() copies the
respective range from s->l1_table to the local "buf" array. The size of
s->l1_table does not have to be a multiple of L1_ENTRIES_PER_SECTOR;
thus, limit the index which is used for copying all entries to the L1
size.

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Reviewed-by: default avatarPeter Lieven <pl@kamp.de>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
(cherry picked from commit a1391444)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent ff830f9d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment