2013-09-03 19:01:17 +00:00
|
|
|
From ab2662a8074e329e15d92ee5bdce741b84901c4a Mon Sep 17 00:00:00 2001
|
2013-08-18 10:25:16 +00:00
|
|
|
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <mlureau@redhat.com>
|
|
|
|
Date: Wed, 21 Nov 2012 14:16:08 +0100
|
2013-09-03 19:01:17 +00:00
|
|
|
Subject: [PATCH] ccid-card-emul: do not crash if backend is not provided
|
2013-08-18 10:25:16 +00:00
|
|
|
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;
|