From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIIm-0008Oq-Oj for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUIIk-0001Rc-NX for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIIk-0001Q4-B1 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:06 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3MF558E022343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Apr 2013 11:05:05 -0400 From: Alon Levy Date: Mon, 22 Apr 2013 18:04:32 +0300 Message-Id: <1366643098-2566-3-git-send-email-alevy@redhat.com> In-Reply-To: <1366643098-2566-1-git-send-email-alevy@redhat.com> References: <1366643098-2566-1-git-send-email-alevy@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 02/28] ccid-card-emul: do not crash if backend is not provided List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mlureau@redhat.com From: Marc-Andr=C3=A9 Lureau Program received signal SIGSEGV, Segmentation fault. __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164 164 movdqu (%rsi), %xmm2 (gdb) bt at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:477 at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:503 --- hw/usb/ccid-card-emulated.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index d534c94..6cbb176 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -473,6 +473,9 @@ static uint32_t parse_enumeration(char *str, { uint32_t ret =3D not_found_value; =20 + if (str =3D=3D NULL) + return 0; + while (table->name !=3D NULL) { if (strcmp(table->name, str) =3D=3D 0) { ret =3D table->value; --=20 1.8.2