qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/8] usb: fix unbounded stack for usb_mtp_add_st


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH 6/8] usb: fix unbounded stack for usb_mtp_add_str
Date: Wed, 9 Mar 2016 13:29:59 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Mar 08, 2016 at 09:10:44AM +0100, Gerd Hoffmann wrote:
> >  static void usb_mtp_add_str(MTPData *data, const char *str)
> >  {
> > +#define __WSTR_LEN (256)
> >      uint32_t len = strlen(str)+1;
> > -    wchar_t wstr[len];
> > +    wchar_t wstr[__WSTR_LEN];
> 
> I think we should g_malloc() here.

Agree. Will fix. Thanks.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]