Re: [libvirt] [PATCH] Avoid a libvirtd crash on broken input 523418

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

 



On Wed, 2009-09-30 at 18:33 +0200, Daniel Veillard wrote:
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 868e865..9cf0af1 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1032,7 +1032,8 @@ virDomainNetDefParseXML(virConnectPtr conn,
>              } else if ((ifname == NULL) &&
>                         xmlStrEqual(cur->name, BAD_CAST "target")) {
>                  ifname = virXMLPropString(cur, "dev");
> -                if (STRPREFIX((const char*)ifname, "vnet")) {
> +                if ((ifname != NULL) &&
> +                    (STRPREFIX((const char*)ifname, "vnet"))) {
>                      /* An auto-generated target name, blank it out */
>                      VIR_FREE(ifname);
>                  }

Modulo the redundant parenthesis, looks good to me :-)

ACK

Cheers,
Mark.

--
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]