]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.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)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Apr 2014 12:19:09 +0000 (14:19 +0200)
commit6d33e8e7dc9d40ea105feed4b39caa3e641569e8
treedc0f7b63b5d42aa84af6f51dffe16c4193594c59
parent2d51c32c4b511db8bb9e58208f1e2c25e4c06c85
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>
block/qcow2.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out