Re: [PATCH] qemu: Avoid use after free in qemuCaps parsing

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

 



On Fri, Jun 03, 2011 at 04:34:30PM +0200, Jiri Denemark wrote:
> ---
>  src/qemu/qemu_domain.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 46414cd..332c09e 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -264,12 +264,13 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
>              char *str = virXMLPropString(nodes[i], "name");
>              if (str) {
>                  int flag = qemuCapsTypeFromString(str);
> -                VIR_FREE(str);
>                  if (flag < 0) {
>                      qemuReportError(VIR_ERR_INTERNAL_ERROR,
>                                      _("Unknown qemu capabilities flag %s"), str);
> +                    VIR_FREE(str);
>                      goto error;
>                  }
> +                VIR_FREE(str);
>                  qemuCapsSet(qemuCaps, flag);
>              }
>          }

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]