From: Gerd Hoffmann Date: Fri, 25 Apr 2014 10:06:47 +0000 (+0200) Subject: usb: mtp: avoid empty description string X-Git-Tag: v2.1.0-rc0~147^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=457d397a2485225a96d6a9fc33cfe04f99e1e0f4;p=thirdparty%2Fqemu.git usb: mtp: avoid empty description string Signed-off-by: Gerd Hoffmann Reviewed-by: Peter Wu Reviewed-by: Stefan Hajnoczi --- diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 45f9562c609..a30a88639c3 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1046,7 +1046,7 @@ static int usb_mtp_initfn(USBDevice *dev) QTAILQ_INIT(&s->objects); if (s->desc == NULL) { s->desc = strrchr(s->root, '/'); - if (s->desc) { + if (s->desc && s->desc[0]) { s->desc = g_strdup(s->desc + 1); } else { s->desc = g_strdup("none");