]> xenbits.xensource.com Git - qemu-xen.git/commit
usb-mtp: fix alignment of access of ObjectInfo filename field
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 15 Apr 2019 15:45:03 +0000 (16:45 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Fri, 26 Jul 2019 10:07:32 +0000 (11:07 +0100)
commit1bcf484fa9f451cc8c290fe80fd0e764199ca81c
treefd1458a93f9d45ee4b0d993e31a11698c6658011
parent9cca02d8ffc23e9688a971d858e4ffdff5389b11
usb-mtp: fix alignment of access of ObjectInfo filename field

The ObjectInfo struct's "filename" field is following a uint8_t
field in a packed struct and thus has bad alignment for a 16-bit
field. Switch the field to to uint8_t and use the helper function
for accessing unaligned 16-bit data.

Note that although the MTP spec specifies big endian, when transported
over the USB protocol, data is little endian.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190415154503.6758-4-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 1259f27ec2113d34e54ee731aac5990d9606d9fa)
hw/usb/dev-mtp.c