From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: alevy@redhat.com, kraxel@redhat.com, Cole Robinson <crobinso@redhat.com>
Subject: [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified
Date: Sun, 14 Apr 2013 16:06:59 -0400 [thread overview]
Message-ID: <681f15c0b6ac898724d68227f34977b106c7fa59.1365969853.git.crobinso@redhat.com> (raw)
Reproducer:
./x86_64-softmmu/qemu-system-x86_64 -device usb-ccid,id=ccid0 -usb -device ccid-card-emulated -monitor stdio
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/usb/ccid-card-emulated.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 29dcd7a..65e1432 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -500,9 +500,15 @@ static int emulated_initfn(CCIDCardState *base)
if (init_pipe_signaling(card) < 0) {
return -1;
}
- card->backend = parse_enumeration(card->backend_str, backend_enum_table, 0);
+
+ card->backend = 0;
+ if (card->backend_str) {
+ card->backend = parse_enumeration(card->backend_str,
+ backend_enum_table, 0);
+ }
+
if (card->backend == 0) {
- printf("unknown backend, must be one of:\n");
+ printf("backend must be one of:\n");
for (ptable = backend_enum_table; ptable->name != NULL; ++ptable) {
printf("%s\n", ptable->name);
}
--
1.8.1.4
next reply other threads:[~2013-04-14 20:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-14 20:06 Cole Robinson [this message]
2013-04-15 8:03 ` [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified Alon Levy
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=681f15c0b6ac898724d68227f34977b106c7fa59.1365969853.git.crobinso@redhat.com \
--to=crobinso@redhat.com \
--cc=alevy@redhat.com \
--cc=kraxel@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 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).