usb-mtp: fix string length for filename when writing metadata
commit3541cd48f32233dd0c0766a3f342e3fd64b04381
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 15 Apr 2019 15:45:01 +0000 (15 16:45 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 2 May 2019 06:29:33 +0000 (2 08:29 +0200)
treefcb6c02f579946148917d76be0a3ea2aefe1415f
parentf75d15231e56cb0f2bafe19faf1229c459a60731
usb-mtp: fix string length for filename when writing metadata

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é <berrange@redhat.com>
Message-id: 20190415154503.6758-2-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c