]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: Fix backing file name length check
authorKevin Wolf <kwolf@redhat.com>
Wed, 26 Mar 2014 12:05:47 +0000 (13:05 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:18:12 +0000 (16:18 -0500)
commit5ba151f4dcca96d47896a5f77fa74ab5b6e9b06f
tree25f4f318bd49cc8952c7d4edbbd8dd4081705c90
parentcd598d41616189f33b35f69a5f7ba70c8112c272
qcow2: Fix backing file name length check

len could become negative and would pass the check then. Nothing bad
happened because bdrv_pread() happens to return an error for negative
length values, but make variables for sizes unsigned anyway.

This patch also changes the behaviour to error out on invalid lengths
instead of silently truncating it to 1023.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 6d33e8e7dc9d40ea105feed4b39caa3e641569e8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out