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

Re: [Xen-devel] [PATCH 3/4] tools/libxl: Fix libxl__device_nic_from_xs_be()



Andrew Cooper writes ("[PATCH 3/4] tools/libxl: Fix 
libxl__device_nic_from_xs_be()"):
> Coverity ID: 1055886
> 
> The callers of xs_read() is required to free the allocated memory.
> Also avoid calling libxl__parse_mac(NULL,) if the second xs_read()
> fails.

I think the first problem would be better fixed by calling
libxl__xs_read_checked with an appropriate gc.

> -    rc = libxl__parse_mac(tmp, nic->mac);
> -    if (rc)
> +
> +    if ( !tmp || libxl__parse_mac(tmp, nic->mac) != 0 )
>          memset(nic->mac, 0, sizeof(nic->mac));

Also, the libxl coding style doesn't have the spaces inside the
parens there.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.