* [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault)
@ 2011-05-17 10:03 Alon Levy
2011-05-25 7:42 ` Markus Armbruster
0 siblings, 1 reply; 2+ messages in thread
From: Alon Levy @ 2011-05-17 10:03 UTC (permalink / raw)
To: qemu-devel
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 <alevy@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault)
2011-05-17 10:03 [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault) Alon Levy
@ 2011-05-25 7:42 ` Markus Armbruster
0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2011-05-25 7:42 UTC (permalink / raw)
To: Alon Levy; +Cc: qemu-devel
Alon Levy <alevy@redhat.com> writes:
> During initialization if no "backend=something" attribute is supplied
> don't try to call strcmp with second argument being NULL.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-25 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 10:03 [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault) Alon Levy
2011-05-25 7:42 ` Markus Armbruster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).