[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfau
From: |
Alon Levy |
Subject: |
[Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault) |
Date: |
Tue, 17 May 2011 13:03:42 +0300 |
During initialization if no "backend=something" attribute is supplied
don't try to call strcmp with second argument being NULL.
Signed-off-by: Alon Levy <address@hidden>
---
hw/ccid-card-emulated.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c
index 0b07184..ba56dca 100644
--- a/hw/ccid-card-emulated.c
+++ b/hw/ccid-card-emulated.c
@@ -476,6 +476,9 @@ static uint32_t parse_enumeration(char *str,
{
uint32_t ret = not_found_value;
+ if (!str) {
+ return ret;
+ }
while (table->name != NULL) {
if (strcmp(table->name, str) == 0) {
ret = table->value;
--
1.7.5.1
- [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault),
Alon Levy <=