Re: [Qemu-devel] [PATCH v2] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-16 Thread Gerd Hoffmann
On Mi, 2016-02-10 at 17:17 +0100, Paolo Bonzini wrote: > 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

[Qemu-devel] [PATCH v2] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Paolo Bonzini
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

Re: [Qemu-devel] [PATCH v2] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Laszlo Ersek
On 02/10/16 17:17, Paolo Bonzini wrote: > 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