From: Jan Kiszka <jan.kiszka@web.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH v2] Avoid crash on '-usbdevice <device>' without parameters
Date: Sun, 07 Mar 2010 12:17:08 +0100 [thread overview]
Message-ID: <4B938B34.60102@web.de> (raw)
In-Reply-To: <4B938494.1040100@web.de>
Many usbdevice_init implementors assume params is non-NULL.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
Build fixed - sorry.
hw/usb-bus.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 7c82314..3bb8986 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -264,7 +264,8 @@ USBDevice *usbdevice_create(const char *cmdline)
USBBus *bus = usb_bus_find(-1 /* any */);
DeviceInfo *info;
USBDeviceInfo *usb;
- char driver[32], *params;
+ char driver[32];
+ const char *params;
int len;
params = strchr(cmdline,':');
@@ -275,6 +276,7 @@ USBDevice *usbdevice_create(const char *cmdline)
len = sizeof(driver);
pstrcpy(driver, len, cmdline);
} else {
+ params = "";
pstrcpy(driver, sizeof(driver), cmdline);
}
prev parent reply other threads:[~2010-03-07 11:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-07 10:48 [Qemu-devel] [PATCH] Avoid crash on '-usbdevice <device>' without parameters Jan Kiszka
2010-03-07 11:17 ` Jan Kiszka [this message]
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=4B938B34.60102@web.de \
--to=jan.kiszka@web.de \
--cc=aliguori@us.ibm.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).