# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1245859606 25200
# Node ID 76be9533b5bab87a55c14ab68640c82cfd400b7b
# Parent 3fa64e808da1d96eeb7e58f6f0532a4c00deba4b
(#2) Add check to ensure PoolID specified in NetRASD has valid format
Updates from 1 to 2:
-Add a proper subject and commit log to patch
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 3fa64e808da1 -r 76be9533b5ba src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Jun 12 15:11:51 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jun 24 09:06:46 2009 -0700
@@ -537,6 +537,7 @@
{
const char *val = NULL;
const char *msg = NULL;
+ char *network = NULL;
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
val = _net_rand_mac();
@@ -561,8 +562,14 @@
if (val == NULL)
return "No NetworkPool specified and no default available";
+ network = name_from_pool_id(val);
+ if (network == NULL) {
+ msg = "PoolID specified is not formatted properly";
+ goto out;
+ }
+
free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
+ dev->dev.net.source = strdup(network);
free(dev->dev.net.model);
if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)
@@ -571,6 +578,7 @@
dev->dev.net.model = strdup(val);
out:
+ free(network);
return msg;
}
Show replies by date