qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [for-2.11 PATCH 04/26] spapr_drc: use g_strdup_printf()


From: David Gibson
Subject: Re: [Qemu-devel] [for-2.11 PATCH 04/26] spapr_drc: use g_strdup_printf() instead of snprintf()
Date: Mon, 31 Jul 2017 22:53:31 +1000
User-agent: Mutt/1.8.3 (2017-05-23)

On Mon, Jul 31, 2017 at 12:34:41PM +0200, Greg Kurz wrote:
> On Mon, 31 Jul 2017 07:11:45 -0300
> Philippe Mathieu-Daudé <address@hidden> wrote:
> 
> > Hi David,
> > 
> > On 07/26/2017 12:58 AM, David Gibson wrote:
> > > On Tue, Jul 25, 2017 at 07:58:53PM +0200, Greg Kurz wrote:  
> > >> Passing a stack allocated buffer of arbitrary length to snprintf()
> > >> without checking the return value can cause the resultant strings
> > >> to be silently truncated.
> > >>
> > >> Signed-off-by: Greg Kurz <address@hidden>  
> > > 
> > > Applied to ppc-for-2.11.  
> > 
> > Isn't it 2.10 material?
> > 
> 
> Hi Philippe,
> 
> Well... this patch doesn't fix any bug actually since the stack buffers
> are large enough. It is more a question of coding style.
> 
> Something like below would have been more appropriate I guess:
> 
> "Building strings with g_strdup_printf() is a QEMU common practice."
> 
> No big deal.

Exactly.  It's not a bugfix, so it doesn't go into 2.10 - we've passed
the hard freeze.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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