[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/7] usb-mtp: fix string length for filename when wri
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 1/7] usb-mtp: fix string length for filename when writing metadata |
Date: |
Fri, 3 May 2019 08:59:48 +0200 |
From: Daniel P. Berrangé <address@hidden>
The ObjectInfo 'length' field provides the length of the
wide character string filename. This is then converted to
a multi-byte character string. This may have a different
byte count to the wide character string. We should use the
C string length of the multi-byte string instead.
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-mtp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 99548b012d1f..6b7d1296e430 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1721,7 +1721,7 @@ static void usb_mtp_write_metadata(MTPState *s, uint64_t
dlen)
return;
}
- o = usb_mtp_object_lookup_name(p, filename, dataset->length);
+ o = usb_mtp_object_lookup_name(p, filename, -1);
if (o != NULL) {
next_handle = o->handle;
}
--
2.18.1
- [Qemu-devel] [PULL 0/7] Usb 20190503 v2 patches, Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 1/7] usb-mtp: fix string length for filename when writing metadata,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 5/7] hw/usb/hcd-ohci: Do not use PCI functions with sysbus devices in ohci_die(), Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 3/7] usb-mtp: change default to success for usb_mtp_update_object, Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 4/7] usb/xhci: avoid trigger assertion if guest write wrong epid, Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 7/7] hw/usb: avoid format truncation warning when formatting port name, Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 2/7] usb-mtp: fix alignment of access of ObjectInfo filename field, Gerd Hoffmann, 2019/05/03
- [Qemu-devel] [PULL 6/7] hw/usb/hcd-ohci: Move PCI-related code into a separate file, Gerd Hoffmann, 2019/05/03
- Re: [Qemu-devel] [PULL 0/7] Usb 20190503 v2 patches, Peter Maydell, 2019/05/03