[ovirt-devel] Fwd: New Defects reported by Coverity Scan for ovirt-engine

Michal Skrivanek mskrivan at redhat.com
Mon Nov 21 20:48:15 UTC 2016


Not sure who touched that, but since it's a NPE - Tal, can you doublecheck please?


Begin forwarded message:

> From: scan-admin at coverity.com
> Date: 21 November 2016 at 21:13:22 GMT+1
> To: mskrivan at redhat.com
> Subject: New Defects reported by Coverity Scan for ovirt-engine
> 
> 
> Hi,
> 
> Please find the latest report on new defect(s) introduced to ovirt-engine found with Coverity Scan.
> 
> 2 new defect(s) introduced to ovirt-engine found with Coverity Scan.
> 1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
> 
> New defect(s) Reported-by: Coverity Scan
> Showing 2 of 2 defect(s)
> 
> 
> ** CID 1366189:  Null pointer dereferences  (NULL_RETURNS)
> /backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java: 112 in org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc(java.util.Map, org.ovirt.engine.core.compat.Version)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1366189:  Null pointer dereferences  (NULL_RETURNS)
> /backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java: 112 in org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc(java.util.Map, org.ovirt.engine.core.compat.Version)()
> 106                                     .put(xcon.get(PHYSICAL_DEVICE_FIELD).toString(),
> 107                                             DEVICE_ACTIVE_VALUE.equals(xcon.get(DEVICE_STATE_FIELD).toString()));
> 108                         }
> 109                         if (xcon.containsKey(PHYSICAL_DEVICE_FIELD) && xcon.containsKey(DEVICE_PATH_CAPACITY_FIELD)) {
> 110                             // set name and capacity
> 111                             Long size = IrsBrokerCommand.assignLongValue(xcon, DEVICE_PATH_CAPACITY_FIELD);
>>>>    CID 1366189:  Null pointer dereferences  (NULL_RETURNS)
>>>>    Unboxing null object "size".
> 112                             lun.getPathsCapacity()
> 113                                     .put(xcon.get(PHYSICAL_DEVICE_FIELD).toString(),
> 114                                             SizeConverter.convert(size,
> 115                                                     SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB).intValue());
> 116                         }
> 117                     }
> 
> ** CID 1366190:  Resource leaks  (RESOURCE_LEAK)
> /backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/CommandsWeightsUtilsTest.java: 37 in org.ovirt.engine.core.bll.storage.CommandsWeightsUtilsTest.adjustWeights(java.util.List, java.util.List, int)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1366190:  Resource leaks  (RESOURCE_LEAK)
> /backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/CommandsWeightsUtilsTest.java: 37 in org.ovirt.engine.core.bll.storage.CommandsWeightsUtilsTest.adjustWeights(java.util.List, java.util.List, int)()
> 31             adjustWeights(Arrays.<Double> asList(0.33, 0.37, 0.3), Arrays.<Integer> asList(3, 3, 4), 10);
> 32         }
> 33     
> 34         public void adjustWeights(List<Double> weightParts, List<Integer> expectedWeightsSorted, int totalWeight) {
> 35             assertFalse(weightsUtils == null);
> 36             Map<String, Double> map = new HashMap<>();
>>>>    CID 1366190:  Resource leaks  (RESOURCE_LEAK)
>>>>    Failing to save or close resource created by "java.util.stream.IntStream.range(0, weightParts.size())" leaks it.
> 37             IntStream.range(0, weightParts.size()).forEach(i -> map.put(String.valueOf(i), weightParts.get(i)));
> 38             Map<String, Integer> res = weightsUtils.adjust(map, totalWeight);
> 39             assertEquals("adjusted weights sum should be equal to the total weight",
> 40                     totalWeight,
> 41                     res.values().stream().mapToInt(x -> x).sum());
> 42     
> 
> 
> ________________________________________________________________________________________________________
> To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRY9v3SZ-2BLqhn66fucWz5NChdV2QNZzLQCPY1fjqQGlAKjFKQ4pnDnQ8dtAwvCE2G0E-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnTXIjnZdjb0Cw-2FiZV5z3DRotm2ow-2BiwdoVplKeuk7nRFrRXzS4jJb3IZXBSxeZC0bc8KPnuElHCtQryUJ5u-2FY6QjMUnZuFDu-2BC21coRtHfPr1uF9ZCvkTQAT-2Bg5drHSbNPaszp0YnZzvaUGArGUlXQkPt48dc-2FNZaixgGomwsPPQ-3D
> 
> To manage Coverity Scan email notifications for "mskrivan at redhat.com", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4QYNJdvz3-2Bo6D7kzKGM4BieGXcFZeVj8bblbpPZS135zo-2F9pagiHHlVMtL1t-2BQNkdMMpi2fcAFj8yWlY6sxZhzNUWHvSkeP6LdDHUGDSs8PI-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnYwmACJZZa-2BkRa13JTRgm4K6JnogNoqDZTzNvLRxP6Val1P03EDtJ3QxTG8urJ-2FCTuXNzEDZ24au9cRqVgy9YVPOiVSvw7tAY4dzssRc8ERmy1mCzlCbU6-2B9s01kYf0EYko6e7QKj2VpVxVJD8bRNr-2FNXcUSv-2Bu1fA612id1LcCM-3D
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20161121/0b8018cc/attachment-0001.html>


More information about the Devel mailing list