On 26.03.2014 13:05, Stefan Hajnoczi wrote:
From: Kevin Wolf <kw...@redhat.com>

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 <kw...@redhat.com>
---
  block/qcow2.c              | 9 ++++++---
  tests/qemu-iotests/080     | 8 ++++++++
  tests/qemu-iotests/080.out | 5 +++++
  3 files changed, 19 insertions(+), 3 deletions(-)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to