cirrus: fix blit region check
commitd3532a0db02296e687711b8cdc7791924efccea0
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 19 Nov 2014 10:37:42 +0000 (19 11:37 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 1 Dec 2014 09:25:12 +0000 (1 10:25 +0100)
treef1b35defb8a47354f105aa4a3f443025131a0273
parentdb12451decf7dfe0f083564183e135f2095228b9
cirrus: fix blit region check

Issues:
 * Doesn't check pitches correctly in case it is negative.
 * Doesn't check width at all.

Turn macro into functions while being at it, also factor out the check
for one region which we then can simply call twice for src + dst.

This is CVE-2014-8106.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
hw/display/cirrus_vga.c