From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault)
Date: Tue, 17 May 2011 13:03:42 +0300 [thread overview]
Message-ID: <1305626622-12925-1-git-send-email-alevy@redhat.com> (raw)
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
next reply other threads:[~2011-05-17 10:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 10:03 Alon Levy [this message]
2011-05-25 7:42 ` [Qemu-devel] [PATCH] ccid-card-emulated: handle no backend (fixes segfault) Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305626622-12925-1-git-send-email-alevy@redhat.com \
--to=alevy@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.