]> Git Repo - qemu.git/commit - hw/display/cirrus_vga.c
cirrus_vga: fix off-by-one in blit_region_is_unsafe
authorPaolo Bonzini <[email protected]>
Wed, 10 Feb 2016 16:17:39 +0000 (17:17 +0100)
committerGerd Hoffmann <[email protected]>
Tue, 1 Mar 2016 06:51:32 +0000 (07:51 +0100)
commitd2ba7ecb348d3b996fcd920cf1ca7b72722c1dfd
treef18d1f4efca017b9b0d603b5461cf41bd23227c0
parent071608b519adf62bc29c914343a21c5407ab1ac9
cirrus_vga: fix off-by-one in blit_region_is_unsafe

The "max" value is being compared with >=, but addr + width points to
the first byte that will _not_ be copied.  Laszlo suggested using a
"greater than" comparison, instead of subtracting one like it is
already done above for the height, so that max remains always positive.

The mistake is "safe"---it will reject some blits, but will never cause
out-of-bounds writes.

Cc: Gerd Hoffmann <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Message-id: 1455121059[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/display/cirrus_vga.c
This page took 0.024928 seconds and 4 git commands to generate.