diff options
author | Kevin Wolf | 2014-04-14 14:47:14 +0200 |
---|---|---|
committer | Kevin Wolf | 2014-04-22 11:57:02 +0200 |
commit | 54db38a47978381e23e7f6479c31a97b5d352f7e (patch) | |
tree | a314e16120a6a5c8a6ce196befe29bf7e8c65351 | |
parent | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140417-... (diff) | |
download | qemu-54db38a47978381e23e7f6479c31a97b5d352f7e.tar.gz qemu-54db38a47978381e23e7f6479c31a97b5d352f7e.tar.xz qemu-54db38a47978381e23e7f6479c31a97b5d352f7e.zip |
block: Fix nb_sectors check in bdrv_check_byte_request()
nb_sectors is signed, check for negative values.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2601,7 +2601,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { - if (nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) { + if (nb_sectors < 0 || nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) { return -EIO; } |