qemu/0213-ccid-card-emul-do-not-crash-if-backend-is-not-provid.patch
Cole Robinson 18389bf646 Fix crash with -M isapc -cpu Haswell (bz #986790)
Fix crash in lsi_soft_reset (bz #1000947)
Fix crash in scsi_dma_complete (bz #1001617)
Fix initial /dev/kvm permissions (bz #993491)
2013-09-03 15:01:17 -04:00

37 lines
1.3 KiB
Diff

From ab2662a8074e329e15d92ee5bdce741b84901c4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <mlureau@redhat.com>
Date: Wed, 21 Nov 2012 14:16:08 +0100
Subject: [PATCH] ccid-card-emul: do not crash if backend is not provided
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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
Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
(cherry picked from commit d0ebd78890fba2ab458ec34763dae8566ccb1b72)
---
hw/ccid-card-emulated.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c
index c8f8ba3..210433e 100644
--- a/hw/ccid-card-emulated.c
+++ b/hw/ccid-card-emulated.c
@@ -473,6 +473,9 @@ static uint32_t parse_enumeration(char *str,
{
uint32_t ret = not_found_value;
+ if (str == NULL)
+ return 0;
+
while (table->name != NULL) {
if (strcmp(table->name, str) == 0) {
ret = table->value;