[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/14] usb-mtp: fix string length for filename when
From: |
Daniel P . Berrangé |
Subject: |
[Qemu-devel] [PATCH 09/14] usb-mtp: fix string length for filename when writing metadata |
Date: |
Fri, 29 Mar 2019 11:10:59 +0000 |
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>
---
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 06e376bcd2..5343449663 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1718,7 +1718,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.20.1
- [Qemu-devel] [PATCH 00/14] misc set of fixes for warnings under GCC 9, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 01/14] target/xtensa: fix break_dependency for repeated resources, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 02/14] target/xtensa: don't announce exit simcall, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 03/14] tests/tcg/xtensa: clean up test set, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 04/14] linux-user: avoid string truncation warnings in uname field copying, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 05/14] linux-user: avoid string truncation warnings in elf field copying, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 06/14] sockets: avoid string truncation warnings when copying UNIX path, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 07/14] hw/usb: avoid format truncation warning when formatting port name, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 09/14] usb-mtp: fix string length for filename when writing metadata,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH 08/14] qxl: avoid unaligned pointer reads/writes, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 10/14] usb-mtp: avoid warning about unaligned access to filename, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 11/14] hw/vfio/ccw: avoid taking address members in packed structs, Daniel P . Berrangé, 2019/03/29