On Mon, 3 Dec 2018 at 10:15, Gerd Hoffmann <kra...@redhat.com> wrote:
>
> Make utf16_to_str return an allocated string.  Remove the assumtion that
> the number of string bytes equals the number of utf16 chars (which is
> only true for ascii chars).  Instead call wcstombs twice, once to figure
> the storage size and once for the actual conversion (as suggested by the
> wcstombs manpage).
>
> Reported-by: Michael Hanselmann <pub...@hansmi.ch>
> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
>  hw/usb/dev-mtp.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to