[PATCH] RegisteredProfile: getInstance with wrong hypervisor segfaults

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1201860600 -3600 # Node ID 405c0a9cdc3f8a2e3fce2a5245f23a1645ccc5ea # Parent d03cf2a819d5df30e4c67ba0b733e14cc0d41607 RegisteredProfile: getInstance with wrong hypervisor segfaults wbemgi 'http://localhost:5988/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' on a KVM system segfaults. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r d03cf2a819d5 -r 405c0a9cdc3f src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Thu Jan 31 11:01:59 2008 +0100 +++ b/src/Virt_RegisteredProfile.c Fri Feb 01 11:10:00 2008 +0100 @@ -134,8 +134,12 @@ static CMPIStatus get_prof(const CMPIObj int i; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); - if (conn == NULL) - return s; + if (conn == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance"); + goto out; + } if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s,

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1201860600 -3600 # Node ID 405c0a9cdc3f8a2e3fce2a5245f23a1645ccc5ea # Parent d03cf2a819d5df30e4c67ba0b733e14cc0d41607 RegisteredProfile: getInstance with wrong hypervisor segfaults
Another good catch Heidi. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Heidi Eckhart
-
Kaitlin Rupert