[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [for-2.11 PATCH 04/26] spapr_drc: use g_strd
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [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
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [for-2.11 PATCH 02/26] spapr_pci: use memory_region_add_subregion() with DMA windows, (continued)
[Qemu-ppc] [for-2.11 PATCH 05/26] spapr_iommu: convert TCE table object to realize(), Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 06/26] spapr_pci: parent the MSI memory region to the PHB, Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 07/26] spapr_drc: fix realize and unrealize, Greg Kurz, 2017/07/25