All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, jsnow@redhat.com, famz@redhat.com,
	qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 4/6] block: move string allocation from stack to the heap
Date: Thu, 22 Jan 2015 07:15:23 -0500	[thread overview]
Message-ID: <20150122121523.GA31810@localhost.localdomain> (raw)
In-Reply-To: <20150122113754.GD28491@stefanha-thinkpad.redhat.com>

On Thu, Jan 22, 2015 at 11:37:54AM +0000, Stefan Hajnoczi wrote:
> On Tue, Jan 20, 2015 at 12:31:31PM -0500, Jeff Cody wrote:
> > Rather than allocate PATH_MAX bytes on the stack, use g_strndup() to
> > dynamically allocate the string, and add an exit label for cleanup.
> > 
> > Signed-off-by: Jeff Cody <jcody@redhat.com>
> > ---
> >  block.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> Zombie alert!
> 
> This is a funny:
> 
> Since September 2012 in commit 0bce597d6ec34b2af802799eb53ebc863c704d05
> ("block: convert bdrv_commit() to use bdrv_reopen()") the filename
> variable has not been used.
> 
> We continued to maintain this variable faithfully, for example, to fix a
> buffer overflow in commit c2cba3d9314f972dfaf724d0ec2d018eb54c95f1
> ("block: avoid buffer overrun by using pstrcpy, not strncpy").
> 
> Please kill the zombie filename variable instead of switching to heap
> allocation :-).

Ha! OK, will kill the zombie :)

  reply	other threads:[~2015-01-22 12:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 17:31 [Qemu-devel] [PATCH v2 0/6] RESEND - Update filename string sizes in block layer Jeff Cody
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 1/6] block: vmdk - make ret variable usage clear Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 10:56   ` Stefan Hajnoczi
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 2/6] block: vmdk - move string allocations from stack to the heap Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 11:17   ` Stefan Hajnoczi
2015-01-22 11:23     ` Daniel P. Berrange
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 3/6] block: qapi - move string allocation " Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 11:24   ` Stefan Hajnoczi
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 4/6] block: " Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 11:37   ` Stefan Hajnoczi
2015-01-22 12:15     ` Jeff Cody [this message]
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 11:41   ` Stefan Hajnoczi
2015-01-20 17:31 ` [Qemu-devel] [PATCH v2 6/6] block: update string sizes for filename, backing_file, exact_filename Jeff Cody
2015-01-20 18:37   ` John Snow
2015-01-22 11:46   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150122121523.GA31810@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.