
1089 dev->dev.mem.maxsize = dev->dev.mem.size; (4) Event check_return: Calling function "cu_get_u64_prop(CMPIInstance const *, char const *, uint64_t *)" without checking return value (as is done elsewhere 9 out of 10 times). (14) Event unchecked_value: No check of the return value of "cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize)". 1090 cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); Resolve by adding check and returning a message indicating what's missing --- src/Virt_VirtualSystemManagementService.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c index cbb646d..ebf3e4a 100644 --- a/src/Virt_VirtualSystemManagementService.c +++ b/src/Virt_VirtualSystemManagementService.c @@ -1087,7 +1087,9 @@ static const char *mem_rasd_to_vdev(CMPIInstance *inst, return "Missing `VirtualQuantity' field in Memory RASD"; dev->dev.mem.maxsize = dev->dev.mem.size; - cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); + ret = cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); + if (ret != CMPI_RC_OK) + return "Missing `Limit' field in Memory RASD"; if (cu_get_str_prop(inst, "AllocationUnits", &units) != CMPI_RC_OK) { CU_DEBUG("Memory RASD has no units, assuming bytes"); -- 1.8.1.4