]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: Do not overflow when writing an L1 sector
authorMax Reitz <mreitz@redhat.com>
Thu, 16 Oct 2014 13:25:56 +0000 (15:25 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 00:12:17 +0000 (18:12 -0600)
commit57248587af8090ca0bc7bd0cd672ff15e2ebf8b9
treea2a8eef327e988f24a141bee5cd61200ff2b3f71
parentff830f9d8822f27fce8863b952207b586037f6a5
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: Max Reitz <mreitz@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit a1391444fe1cfef14976458f3293a2c6945e725c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-cluster.c