[netcf-devel] [PATCH] eliminate potential use of uninitialized index/pointer in add_bridge_info

Eric Blake eblake at redhat.com
Thu Aug 4 14:15:15 UTC 2011


On 08/04/2011 08:12 AM, Laine Stump wrote:
> This was detected by Coverity and reported in:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=728184
>
> Commit d32a46 moved the bit of code that adds the<bridge>  element to
> bridge interfaces to the top of the function so that it is always
> done, even if there are no physical devices attached to the bridge
> (because<bridge>  is a required element of the grammar). What wasn't
> noticed is that the ERR_NOMEM macro could goto error, and in this case
> nphys and phys_names would be uninitialized.
>
> Fortunately this would only happen on a failure to allocate memory.
> ---
>   src/dutil_linux.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


More information about the netcf-devel mailing list