Richard Maciel wrote:
On 10/28/2009 06:01 PM, Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert<karupert(a)us.ibm.com>
> # Date 1256771106 25200
> # Node ID 68c625f1d36545bc3de39ae0c1402914d8dc2b58
> # Parent 4eed878f31e95806a9cd345f656b7382945b8985
> Fix seg fault in Virt_DevicePool - verify to be sure list is not NULL
>
> This can happen if _get_pools() is unable to connect to libvirt.
>
> diff -r 4eed878f31e9 -r 68c625f1d365 src/Virt_DevicePool.c
> --- a/src/Virt_DevicePool.c Mon Oct 26 07:47:48 2009 -0700
> +++ b/src/Virt_DevicePool.c Wed Oct 28 16:05:06 2009 -0700
> @@ -1210,6 +1210,14 @@
> if (s.rc != CMPI_RC_OK)
> goto out;
>
> + if (list.cur<= 0) {
This is probably nitpicking, but the cur member is an unsigned int, so
its value won't ever be less than 0. :-P
This is a good point =) Plus, I'm not adhering to coding standards in
this line. Oops! So it needs to be changed anyway.
Thanks!
> + cu_statusf(broker,&s,
> + CMPI_RC_ERR_NOT_FOUND,
> + "No such instance (%s)",
> + id);
> + goto out;
> + }
> +
> *_inst = list.list[0];
>
> out:
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim(a)redhat.com
>
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com