This series is a collection of bug fixes for the MTP USB device
(hw/usb/dev-mtp.c), all tracking the same GitLab work item
(https://gitlab.com/qemu-project/qemu/-/work_items/4529).
Although each patch is independent, all the changes are in a single file and
stem from the same issue, so I decided to group them into one series.
v2:
- Three commits of the series were pulled and merged.
- Reset dataset.parent_handle and dataset.format in
usb_mtp_reset_pending_write()
- Use g_utf16_to_utf8() instead of wcstombs() in utf16_to_str() to avoid locale
dependency and properly handle surrogate pairs
- Add corner-case checks in usb_mtp_handle_data()
- Fix coding style
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4529
Suggested-by: Hui Peng <https://gitlab.com/benquike>
Signed-off-by: Tommaso Califano <tcalifano@redhat.com>
Tommaso Califano (6):
hw/usb/dev-mtp: Reset pending write state on cancel, reset and error
hw/usb/dev-mtp: Handle invalid characters in utf16_to_str()
hw/usb/dev-mtp: Validate container length on first data packet
hw/usb/dev-mtp: Detect end of SendObject data correctly
hw/usb/dev-mtp: Zero-initialize command and params in handle_data
hw/usb/dev-mtp: Fix assert failures in usb_mtp_write_metadata()
hw/usb/dev-mtp.c | 87 +++++++++++++++++++++++++++++++++++-------------
1 file changed, 64 insertions(+), 23 deletions(-)
--
2.56.1