summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <mlureau@redhat.com>2012-11-21 14:16:08 +0100
committerAlon Levy <alevy@redhat.com>2013-04-24 11:47:32 +0300
commitd0ebd78890fba2ab458ec34763dae8566ccb1b72 (patch)
tree03dafe97706309f9296ea93d418173f8a545f587
parente2fd2115ce26049335d66ae0ae5e5c0ad06fb498 (diff)
ccid-card-emul: do not crash if backend is not provided
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>
-rw-r--r--hw/usb/ccid-card-emulated.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index d534c94c1..6cbb1766a 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 = not_found_value;
+ if (str == NULL)
+ return 0;
+
while (table->name != NULL) {
if (strcmp(table->name, str) == 0) {
ret = table->value;