Hi,

Please find the latest report on new defect(s) introduced to cloudstack found 
with Coverity Scan.

3 new defect(s) introduced to cloudstack found with Coverity Scan.
2 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 3 of 3 defect(s)


** CID 1320908:  FindBugs: Dodgy code  (FB.BC_VACUOUS_INSTANCEOF)
/server/src/com/cloud/vm/UserVmManagerImpl.java: 2194 in 
com.cloud.vm.UserVmManagerImpl.updateVirtualMachine(org.apache.cloudstack.api.command.user.vm.UpdateVMCmd)()


________________________________________________________________________________________________________
*** CID 1320908:  FindBugs: Dodgy code  (FB.BC_VACUOUS_INSTANCEOF)
/server/src/com/cloud/vm/UserVmManagerImpl.java: 2194 in 
com.cloud.vm.UserVmManagerImpl.updateVirtualMachine(org.apache.cloudstack.api.command.user.vm.UpdateVMCmd)()
2188             }
2189     
2190             if (details != null && !details.isEmpty()) {
2191                 _vmDao.loadDetails(vmInstance);
2192     
2193                 for(Map.Entry<String,String> entry : details.entrySet()) {
>>>     CID 1320908:  FindBugs: Dodgy code  (FB.BC_VACUOUS_INSTANCEOF)
>>>     instanceof will always return true for all nonnull values, since all 
>>> java.util.Map$Entry<java.lang.String,java.lang.String> are instances of 
>>> java.util.Map$Entry
2194                     if(entry instanceof Map.Entry) {
2195                         vmInstance.setDetail(entry.getKey(), 
entry.getValue());
2196                     }
2197                 }
2198                 _vmDao.saveDetails(vmInstance);
2199             }

** CID 1320905:  Null pointer dereferences  (NULL_RETURNS)
/utils/src/main/java/com/cloud/utils/net/NetUtils.java: 1267 in 
com.cloud.utils.net.NetUtils.getIp6FromRange(java.lang.String)()


________________________________________________________________________________________________________
*** CID 1320905:  Null pointer dereferences  (NULL_RETURNS)
/utils/src/main/java/com/cloud/utils/net/NetUtils.java: 1267 in 
com.cloud.utils.net.NetUtils.getIp6FromRange(java.lang.String)()
1261         // Can cover 127 bits
1262         public static String getIp6FromRange(final String ip6Range) {
1263             final String[] ips = ip6Range.split("-");
1264             final String startIp = ips[0];
1265             final IPv6Address start = IPv6Address.fromString(startIp);
1266             final BigInteger gap = countIp6InRange(ip6Range);
>>>     CID 1320905:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "gap".
1267             BigInteger next = new BigInteger(gap.bitLength(), s_rand);
1268             while (next.compareTo(gap) >= 0) {
1269                 next = new BigInteger(gap.bitLength(), s_rand);
1270             }
1271             InetAddress resultAddr = null;
1272             final BigInteger startInt = 
convertIPv6AddressToBigInteger(start);

** CID 1320904:  Null pointer dereferences  (NULL_RETURNS)
/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java:
 53 in 
org.apache.cloudstack.utils.imagestore.ImageStoreUtil.checkTemplateFormat(java.lang.String,
 java.lang.String)()


________________________________________________________________________________________________________
*** CID 1320904:  Null pointer dereferences  (NULL_RETURNS)
/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java:
 53 in 
org.apache.cloudstack.utils.imagestore.ImageStoreUtil.checkTemplateFormat(java.lang.String,
 java.lang.String)()
47             if (isCompressedExtension(uripath)) {
48                 command = "file -z ";
49             }
50             String output = Script.runSimpleBashScript(command + path + " | 
cut -d: -f2", 60000);
51     
52             // vmdk
>>>     CID 1320904:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "output".
53             if ((output.contains("VMware") || output.contains("data")) && 
isCorrectExtension(uripath, "vmdk")) {
54                 s_logger.debug("File at path " + path + " looks like a 
vmware image :" + output);
55                 return "";
56             }
57             // raw
58             if ((output.contains("x86 boot") || output.contains("data")) && 
(isCorrectExtension(uripath, "raw") || isCorrectExtension(uripath, "img"))) {


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/cloudstack?tab=overview

To manage Coverity Scan email notifications for "dev@cloudstack.apache.org", 
click 
https://scan.coverity.com/subscriptions/edit?email=dev%40cloudstack.apache.org&token=494aabd5ba647999fa41b6d766646231

Reply via email to