Received: from eggs.gnu.org ([2001:4830:134:3::10]:58686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0zy1-0003Ko-AH for qemu-devel@nongnu.org; Fri, 05 Jun 2015 18:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0zxy-0000je-Kc for qemu-devel@nongnu.org; Fri, 05 Jun 2015 18:19:57 -0400 Received: from gateway30.websitewelcome.com ([192.185.198.26]:47980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0zxy-0000jX-GO for qemu-devel@nongnu.org; Fri, 05 Jun 2015 18:19:54 -0400 Received: from gator4003.hostgator.com (gator4003.hostgator.com [192.185.4.14]) by gateway30.websitewelcome.com (Postfix) with ESMTP id E5B693D783993 for ; Fri, 5 Jun 2015 17:19:53 -0500 (CDT) Received: from clownix by gator4003.hostgator.com with local (Exim 4.82) (envelope-from ) id 1Z0zxx-0000Vg-MH for qemu-devel@nongnu.org; Fri, 05 Jun 2015 17:19:53 -0500 Message-ID: <3a37931fe0e17adc26bdaa23e33f0aa8.squirrel@gator4003.hostgator.com> Date: Fri, 5 Jun 2015 17:19:53 -0500 From: "perrier vincent" MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] segfault in memcmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Using a very old guest (lenny) with spice and vga=3Dcirrus, I have a segfault: FILE: ui/spice-display.c FUNCTION: qemu_spice_create_update LINE: if (memcmp(guest + yoff + xoff, mirror + yoff + xoff, bw * bpp) =3D=3D 0) The address of mirror + yoff + xoff is out of boundaries. I use the following to avoid the crash: ... img_get_stride =3D pixman_image_get_stride(ssd->mirror); img_height =3D pixman_image_get_height(ssd->mirror); img_max =3D img_height * img_get_stride; ... if (yoff > img_max) { if (dirty_top[blk] =3D=3D -1) dirty_top[blk] =3D y; } else if (memcmp(guest + yoff + xoff, mirror + yoff + xoff, bw * bpp) =3D=3D 0) { ...