From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVfiN-0000lN-SE for qemu-devel@nongnu.org; Tue, 16 Feb 2016 08:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVfiK-0006xo-Jm for qemu-devel@nongnu.org; Tue, 16 Feb 2016 08:30:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVfiK-0006xY-Dl for qemu-devel@nongnu.org; Tue, 16 Feb 2016 08:30:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 19CA9B5980 for ; Tue, 16 Feb 2016 13:30:48 +0000 (UTC) Message-ID: <1455629446.7504.91.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 16 Feb 2016 14:30:46 +0100 In-Reply-To: <1455121059-18280-1-git-send-email-pbonzini@redhat.com> References: <1455121059-18280-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] cirrus_vga: fix off-by-one in blit_region_is_unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: lersek@redhat.com, qemu-devel@nongnu.org On Mi, 2016-02-10 at 17:17 +0100, Paolo Bonzini wrote: > The "max" value is being compared with >=3D, 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. >=20 > The mistake is "safe"---it will reject some blits, but will never > cause > out-of-bounds writes. added to vga queue. thanks, Gerd