qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: mdroth <mdroth@linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH 3/3] savevm: avoid leaking popen(3) file pointer
Date: Wed, 12 Jun 2013 09:16:57 +0200	[thread overview]
Message-ID: <20130612071657.GB867@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <20130611225931.GE12585@vm>

On Tue, Jun 11, 2013 at 05:59:31PM -0500, mdroth wrote:
> On Thu, May 30, 2013 at 04:14:46PM +0200, Stefan Hajnoczi wrote:
> > I'm not sure why we check the mode only after invoking popen(3) but we
> > need to close the file pointer.
> > 
> > Spotted by Coverity.
> > 
> > Cc: Juan Quintela <quintela@redhat.com>
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> Ping, looking to get this in for 1.5.1
> 
> > ---
> >  savevm.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/savevm.c b/savevm.c
> > index 31dcce9..75cc72e 100644
> > --- a/savevm.c
> > +++ b/savevm.c
> > @@ -329,6 +329,7 @@ QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
> > 
> >      if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
> >          fprintf(stderr, "qemu_popen: Argument validity check failed\n");
> > +        fclose(stdio_file);
> >          return NULL;
> >      }

The v2 I sent had Patch 1 picked up by Paolo and Patch 2 is not yet
merged by anyone.

Stefan

      reply	other threads:[~2013-06-12  7:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 14:14 [Qemu-devel] [PATCH 0/3] vhost-scsi, ivshmem, savevm fixes for Coverity issues Stefan Hajnoczi
2013-05-30 14:14 ` [Qemu-devel] [PATCH 1/3] vhost-scsi: fix k->set_guest_notifiers() NULL dereference Stefan Hajnoczi
2013-06-11 22:58   ` mdroth
2013-06-12 12:47     ` Paolo Bonzini
2013-05-30 14:14 ` [Qemu-devel] [PATCH 2/3] ivshmem: add missing error exit(2) Stefan Hajnoczi
2013-06-03 12:22   ` Markus Armbruster
2013-05-30 14:14 ` [Qemu-devel] [PATCH 3/3] savevm: avoid leaking popen(3) file pointer Stefan Hajnoczi
2013-05-30 14:25   ` Eric Blake
2013-05-30 19:34     ` Stefan Hajnoczi
2013-06-11 22:59   ` [Qemu-devel] [Qemu-stable] " mdroth
2013-06-12  7:16     ` Stefan Hajnoczi [this message]

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=20130612071657.GB867@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).