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

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



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.


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