Patchwork Avoid crash on '-usbdevice <device>' without parameters

login
register
mail settings
Submitter Jan Kiszka
Date March 7, 2010, 10:48 a.m.
Message ID <4B938494.1040100@web.de>
Download mbox | patch
Permalink /patch/47076/
State New
Headers show

Comments

Jan Kiszka - March 7, 2010, 10:48 a.m.
Many usbdevice_init implementors assume params is non-NULL.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
 hw/usb-bus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 7c82314..89e2ea6 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -275,6 +275,7 @@  USBDevice *usbdevice_create(const char *cmdline)
             len = sizeof(driver);
         pstrcpy(driver, len, cmdline);
     } else {
+        params = "";
         pstrcpy(driver, sizeof(driver), cmdline);
     }