cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scan-ad...@coverity.com
Subject New Defects reported by Coverity Scan for cloudstack
Date Fri, 08 May 2015 19:21:10 GMT

Hi,

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

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


** CID 1012179:  FindBugs: Dodgy code  (FB.URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Test.java: 79 in ()


________________________________________________________________________________________________________
*** CID 1012179:  FindBugs: Dodgy code  (FB.URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Test.java: 79 in ()
73                 vm.disks.add(dataDisk);
74                 vm.disks.add(dataDisk);
75                 vm.disks.add(dataDisk);
76                 OvmVif.Details vif = new OvmVif.Details();
77                 vif.mac = "00:ff:ff:ff:ff:ee";
78                 vif.bridge = "xenbr0";
>>>     CID 1012179:  FindBugs: Dodgy code  (FB.URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
>>>     Unread public/protected field: com.cloud.ovm.object.OvmVif$Details.type
79                 vif.type = OvmVif.NETFRONT;
80                 vm.vifs.add(vif);
81                 vm.vifs.add(vif);
82                 vm.vifs.add(vif);
83                 vm.vifs.add(vif);
84                 vm.vifs.add(vif);

** CID 1114588:  Concurrent data access violations  (ATOMICITY)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyGCThread.java: 80 in
com.cloud.consoleproxy.ConsoleProxyGCThread.run()()


________________________________________________________________________________________________________
*** CID 1114588:  Concurrent data access violations  (ATOMICITY)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyGCThread.java: 80 in
com.cloud.consoleproxy.ConsoleProxyGCThread.run()()
74                 Enumeration<String> e = connMap.keys();
75                 while (e.hasMoreElements()) {
76                     String key;
77                     ConsoleProxyClient client;
78     
79                     synchronized (connMap) {
>>>     CID 1114588:  Concurrent data access violations  (ATOMICITY)
>>>     Using an unreliable value of "e" inside the second locked section. If the
data that "e" depends on was changed by another thread, this use might be incorrect.
80                         key = e.nextElement();
81                         client = connMap.get(key);
82                     }
83     
84                     long seconds_unused = (System.currentTimeMillis() - client.getClientLastFrontEndActivityTime())
/ 1000;
85                     if (seconds_unused < MAX_SESSION_IDLE_SECONDS) {

** CID 1114589:  Concurrent data access violations  (ATOMICITY)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyClientStatsCollector.java:
58 in com.cloud.consoleproxy.ConsoleProxyClientStatsCollector.setConnections(java.util.Hashtable)()


________________________________________________________________________________________________________
*** CID 1114589:  Concurrent data access violations  (ATOMICITY)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyClientStatsCollector.java:
58 in com.cloud.consoleproxy.ConsoleProxyClientStatsCollector.setConnections(java.util.Hashtable)()
52         private void setConnections(Hashtable<String, ConsoleProxyClient> connMap)
{
53     
54             ArrayList<ConsoleProxyConnection> conns = new ArrayList<ConsoleProxyConnection>();
55             Enumeration<String> e = connMap.keys();
56             while (e.hasMoreElements()) {
57                 synchronized (connMap) {
>>>     CID 1114589:  Concurrent data access violations  (ATOMICITY)
>>>     Using an unreliable value of "e" inside the second locked section. If the
data that "e" depends on was changed by another thread, this use might be incorrect.
58                     String key = e.nextElement();
59                     ConsoleProxyClient client = connMap.get(key);
60     
61                     ConsoleProxyConnection conn = new ConsoleProxyConnection();
62     
63                     conn.id = client.getClientId();

** CID 1114594:  Class hierarchy inconsistencies  (CALL_SUPER)
/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java: 284 in com.cloud.hypervisor.kvm.discoverer.LibvirtServerDiscoverer.configure(java.lang.String,
java.util.Map)()


________________________________________________________________________________________________________
*** CID 1114594:  Class hierarchy inconsistencies  (CALL_SUPER)
/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java: 284 in com.cloud.hypervisor.kvm.discoverer.LibvirtServerDiscoverer.configure(java.lang.String,
java.util.Map)()
278             } else {
279                 return null;
280             }
281         }
282     
283         @Override
>>>     CID 1114594:  Class hierarchy inconsistencies  (CALL_SUPER)
>>>     Missing call to "com.cloud.resource.DiscovererBase.configure(java.lang.String,
java.util.Map)" (as is done elsewhere 6 out of 7 times).
284         public boolean configure(String name, Map<String, Object> params) throws
ConfigurationException {
285             // _setupAgentPath = Script.findScript(getPatchPath(),
286             // "setup_agent.sh");
287             _kvmPrivateNic = _configDao.getValue(Config.KvmPrivateNetwork.key());
288             if (_kvmPrivateNic == null) {
289                 _kvmPrivateNic = "cloudbr0";

** CID 1114638:    (FORWARD_NULL)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java: 303 in com.cloud.consoleproxy.ConsoleProxy.startWithContext(java.util.Properties,
java.lang.Object, byte[], java.lang.String)()
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java: 254 in com.cloud.consoleproxy.ConsoleProxy.startWithContext(java.util.Properties,
java.lang.Object, byte[], java.lang.String)()


________________________________________________________________________________________________________
*** CID 1114638:    (FORWARD_NULL)
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java: 303 in com.cloud.consoleproxy.ConsoleProxy.startWithContext(java.util.Properties,
java.lang.Object, byte[], java.lang.String)()
297                 try {
298                     props.load(confs);
299     
300                     for (Object key : props.keySet()) {
301                         // give properties passed via context high priority, treat properties
from consoleproxy.properties
302                         // as default values
>>>     CID 1114638:    (FORWARD_NULL)
>>>     Calling a method on null object "conf".
303                         if (conf.get(key) == null)
304                             conf.put(key, props.get(key));
305                     }
306                 } catch (Exception e) {
307                     s_logger.error(e.toString(), e);
308                 }
/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java: 254 in com.cloud.consoleproxy.ConsoleProxy.startWithContext(java.util.Properties,
java.lang.Object, byte[], java.lang.String)()
248                 s_logger.warn("Unable to find ensureRoute method, console proxy agent
is not up to date");
249             }
250         }
251     
252         public static void startWithContext(Properties conf, Object context, byte[] ksBits,
String ksPassword) {
253             s_logger.info("Start console proxy with context");
>>>     CID 1114638:    (FORWARD_NULL)
>>>     Comparing "conf" to null implies that "conf" might be null.
254             if (conf != null) {
255                 for (Object key : conf.keySet()) {
256                     s_logger.info("Context property " + (String)key + ": " + conf.getProperty((String)key));
257                 }
258             }
259     

** CID 1114644:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/S3RestServlet.java: 555 in com.cloud.bridge.service.S3RestServlet.processDimeRequest(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()


________________________________________________________________________________________________________
*** CID 1114644:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/S3RestServlet.java: 555 in com.cloud.bridge.service.S3RestServlet.processDimeRequest(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()
549                     InputStream is = ds.getInputStream();
550                     putRequest.setData(is);
551                 }
552     
553                 // -> need to do SOAP level auth here, on failure return the SOAP fault
554                 StringBuffer xml = new StringBuffer();
>>>     CID 1114644:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "putRequest".
555                 String AWSAccessKey = putRequest.getAccessKey();
556                 UserInfo info = ServiceProvider.getInstance().getUserInfo(AWSAccessKey);
557                 try {
558                     S3SoapAuth.verifySignature(putRequest.getSignature(), "PutObject",
putRequest.getRawTimestamp(), AWSAccessKey, info.getSecretKey());
559     
560                 } catch (AxisFault e) {

** CID 1114649:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java: 558 in com.cloud.bridge.service.controller.s3.S3ObjectAction.executePostObject(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()


________________________________________________________________________________________________________
*** CID 1114649:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java: 558 in com.cloud.bridge.service.controller.s3.S3ObjectAction.executePostObject(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()
552                     // -> this is the header data
553                     if (0 < temp.length()) {
554                         value = temp.toString().trim();
555                         temp.setLength(0);
556                         //System.out.println( "param: " + name + " = " + value );
557     
>>>     CID 1114649:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "name".
558                         if (name.equalsIgnoreCase("key")) {
559                             engineRequest.setKey(value);
560                         } else if (name.equalsIgnoreCase("x-amz-acl")) {
561                             engineRequest.setCannedAccess(value);
562                         } else if (isMetaTag) {
563                             S3MetaDataEntry oneMeta = new S3MetaDataEntry();

** CID 1114661:  Null pointer dereferences  (FORWARD_NULL)
/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java: 344 in com.cloud.storage.snapshot.SnapshotManagerImpl.backupSnapshot(java.lang.Long)()


________________________________________________________________________________________________________
*** CID 1114661:  Null pointer dereferences  (FORWARD_NULL)
/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java: 344 in com.cloud.storage.snapshot.SnapshotManagerImpl.backupSnapshot(java.lang.Long)()
338             return snapshot;
339         }
340     
341         @Override
342         public Snapshot backupSnapshot(Long snapshotId) {
343             SnapshotInfo snapshot = snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
>>>     CID 1114661:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "snapshot" to null implies that "snapshot" might be null.
344             if (snapshot != null) {
345                 throw new CloudRuntimeException("Already in the backup snapshot:" + snapshotId);
346             }
347     
348              return snapshotSrv.backupSnapshot(snapshot);
349         }

** CID 1114663:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java: 147
in org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector.findEndPointForImageMove(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()


________________________________________________________________________________________________________
*** CID 1114663:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java: 147
in org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector.findEndPointForImageMove(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
141     
142         protected EndPoint findEndPointForImageMove(DataStore srcStore, DataStore destStore)
{
143             // find any xenserver/kvm host in the scope
144             Scope srcScope = srcStore.getScope();
145             Scope destScope = destStore.getScope();
146             Scope selectedScope = null;
>>>     CID 1114663:  Null pointer dereferences  (FORWARD_NULL)
>>>     Assigning: "poolId" = "null".
147             Long poolId = null;
148     
149             // assumption, at least one of scope should be zone, find the least
150             // scope
151             if (srcScope.getScopeType() != ScopeType.ZONE) {
152                 selectedScope = srcScope;

** CID 1114666:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1114666:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java: 322
in org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.deleteAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataObject,
org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
316                 CreateCmdResult res = new CreateCmdResult(null, null);
317                 callback.complete(res);
318             }
319     
320             DeleteContext<CommandResult> context = new DeleteContext<CommandResult>(callback,
data);
321             AsyncCallbackDispatcher<DataObjectManagerImpl, CommandResult> caller
= AsyncCallbackDispatcher.create(this);
>>>     CID 1114666:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing "null" to function "org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.deleteAsynCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.DeleteContext)", which dereferences
it.
322             caller.setCallback(caller.getTarget().deleteAsynCallback(null, null)).setContext(context);
323     
324             data.getDataStore().getDriver().deleteAsync(data.getDataStore(), data, caller);
325             return;
326         }
327     

** CID 1114667:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1114667:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java: 246
in org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.copyAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataObject,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject, org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
240                 res.setResult("Failed to change state: " + e.toString());
241                 callback.complete(res);
242             }
243     
244             CopyContext<CreateCmdResult> anotherCall = new CopyContext<CreateCmdResult>(callback,
srcData, destData);
245             AsyncCallbackDispatcher<DataObjectManagerImpl, CopyCommandResult> caller
= AsyncCallbackDispatcher.create(this);
>>>     CID 1114667:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing "null" to function "org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.copyCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
org.apache.cloudstack.storage.datastore.DataObjectManagerImpl.CopyContext)", which dereferences
it.
246             caller.setCallback(caller.getTarget().copyCallback(null, null)).setContext(anotherCall);
247     
248             motionSrv.copyAsync(srcData, destData, caller);
249         }
250     
251         protected Void copyCallback(AsyncCallbackDispatcher<DataObjectManagerImpl,
CopyCommandResult> callback, CopyContext<CreateCmdResult> context) {

** CID 1114683:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 596 in com.cloud.bridge.service.core.s3.S3Engine.saveUploadPart(com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest,
int, int)()


________________________________________________________________________________________________________
*** CID 1114683:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 596 in com.cloud.bridge.service.core.s3.S3Engine.saveUploadPart(com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest,
int, int)()
590             if (bucket == null) {
591                 logger.error("saveUploadedPart failed since " + bucketName + " does not
exist");
592                 response.setResultCode(404);
593             }
594             S3PolicyContext context = new S3PolicyContext(PolicyActions.PutObject, bucketName);
595             context.setKeyName(request.getKey());
>>>     CID 1114683:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "bucket".
596             verifyAccess(context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE);
597     
598             OrderedPair<SHostVO, String> host_storagelocation_pair = getBucketStorageHost(bucket);
599             S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst());
600             String itemFileName = new String(uploadId + "-" + partNumber);
601             InputStream is = null;

** CID 1114684:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 556 in com.cloud.bridge.service.core.s3.S3Engine.initiateMultipartUpload(com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest)()


________________________________________________________________________________________________________
*** CID 1114684:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 556 in com.cloud.bridge.service.core.s3.S3Engine.initiateMultipartUpload(com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest)()
550                 response.setResultCode(404);
551             }
552     
553             S3PolicyContext context = new S3PolicyContext(PolicyActions.PutObject, bucketName);
554             context.setKeyName(nameKey);
555             context.setEvalParam(ConditionKeys.Acl, request.getCannedAccess());
>>>     CID 1114684:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "bucket".
556             verifyAccess(context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE);
557     
558             createUploadFolder(bucketName);
559     
560             try {
561                 MultipartLoadDao uploadDao = new MultipartLoadDao();

** CID 1114685:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 653 in com.cloud.bridge.service.core.s3.S3Engine.concatentateMultipartUploads(javax.servlet.http.HttpServletResponse,
com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest, com.cloud.bridge.service.core.s3.S3MultipartPart[],
java.io.OutputStream)()


________________________________________________________________________________________________________
*** CID 1114685:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 653 in com.cloud.bridge.service.core.s3.S3Engine.concatentateMultipartUploads(javax.servlet.http.HttpServletResponse,
com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest, com.cloud.bridge.service.core.s3.S3MultipartPart[],
java.io.OutputStream)()
647             S3PutObjectInlineResponse response = new S3PutObjectInlineResponse();
648             String bucketName = request.getBucketName();
649             String key = request.getKey();
650             S3MetaDataEntry[] meta = request.getMetaEntries();
651     
652             SBucketVO bucket = bucketDao.getByName(bucketName);
>>>     CID 1114685:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "bucket" to null implies that "bucket" might be null.
653             if (bucket == null) {
654                 logger.error("completeMultipartUpload( failed since " + bucketName + "
does not exist");
655                 response.setResultCode(404);
656             }
657     
658             // [B] Now we need to create the final re-assembled object

** CID 1114686:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 377 in com.cloud.bridge.service.core.s3.S3Engine.listBucketContents(com.cloud.bridge.service.core.s3.S3ListBucketRequest,
boolean)()


________________________________________________________________________________________________________
*** CID 1114686:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java: 377 in com.cloud.bridge.service.core.s3.S3Engine.listBucketContents(com.cloud.bridge.service.core.s3.S3ListBucketRequest,
boolean)()
371     
372             response.setBucketName(bucketName);
373             response.setMarker(marker);
374             response.setMaxKeys(maxKeys);
375             response.setPrefix(prefix);
376             response.setDelimiter(delimiter);
>>>     CID 1114686:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "l" to null implies that "l" might be null.
377             if (null != l) {
378                 response.setTruncated(l.size() > maxKeys);
379                 if (l.size() > maxKeys) {
380                     response.setNextMarker(l.get(l.size() - 1).getNameKey());
381                 }
382             }

** CID 1114691:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java: 77 in com.cloud.bridge.service.core.s3.S3HostCallingFormat.pathArgsMapToString(java.util.Map)()


________________________________________________________________________________________________________
*** CID 1114691:  Null pointer dereferences  (FORWARD_NULL)
/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java: 77 in com.cloud.bridge.service.core.s3.S3HostCallingFormat.pathArgsMapToString(java.util.Map)()
71                 for (argumentIterator = pathArgs.keySet().iterator(); argumentIterator.hasNext();)
{
72                     argument = (String)argumentIterator.next();
73                     pathArgsString.append(firstArgPosition ? "?" : "&");
74                     firstArgPosition = false;
75                 }
76             }
>>>     CID 1114691:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "pathArgs".
77             String argumentValue = (String)pathArgs.get(argument);
78             if (argumentValue != null) {
79                 pathArgsString.append("=");
80                 pathArgsString.append(argumentValue);
81             }
82             return pathArgsString.toString();

** CID 1114884:  Null pointer dereferences  (FORWARD_NULL)
/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
738 in org.apache.cloudstack.engine.orchestration.NetworkOrchestrator$3.doInTransactionWithoutResult(com.cloud.utils.db.TransactionStatus)()


________________________________________________________________________________________________________
*** CID 1114884:  Null pointer dereferences  (FORWARD_NULL)
/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
738 in org.apache.cloudstack.engine.orchestration.NetworkOrchestrator$3.doInTransactionWithoutResult(com.cloud.utils.db.TransactionStatus)()
732                         if (requestedProfiles.isEmpty()) {
733                             requestedProfiles.add(null);
734                         }
735     
736                         for (NicProfile requested : requestedProfiles) {
737                             Boolean isDefaultNic = false;
>>>     CID 1114884:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "this.val$vm" to null implies that "this.val$vm" might be null.
738                             if (vm != null && (requested != null && requested.isDefaultNic()))
{
739                                 isDefaultNic = true;
740                             }
741     
742                             while (deviceIds[deviceId] && deviceId < deviceIds.length)
{
743                                 deviceId++;

** CID 1115080:    (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1115080:    (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java: 124
in org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject, org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
118         @Override
119         public void createAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CreateCmdResult>
callback) {
120             CreateContext<CreateCmdResult> context = new CreateContext<CreateCmdResult>(callback,
data);
121             AsyncCallbackDispatcher<BaseImageStoreDriverImpl, DownloadAnswer> caller
= AsyncCallbackDispatcher.create(this);
122             caller.setContext(context);
123             if (data.getType() == DataObjectType.TEMPLATE) {
>>>     CID 1115080:    (FORWARD_NULL)
>>>     Passing "null" to function "org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createTemplateAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.CreateContext)", which dereferences
it.
124                 caller.setCallback(caller.getTarget().createTemplateAsyncCallback(null,
null));
125                 if (s_logger.isDebugEnabled()) {
126                     s_logger.debug("Downloading template to data store " + dataStore.getId());
127                 }
128                 _downloadMonitor.downloadTemplateToStorage(data, caller);
129             } else if (data.getType() == DataObjectType.VOLUME) {
/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java: 130
in org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject, org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
124                 caller.setCallback(caller.getTarget().createTemplateAsyncCallback(null,
null));
125                 if (s_logger.isDebugEnabled()) {
126                     s_logger.debug("Downloading template to data store " + dataStore.getId());
127                 }
128                 _downloadMonitor.downloadTemplateToStorage(data, caller);
129             } else if (data.getType() == DataObjectType.VOLUME) {
>>>     CID 1115080:    (FORWARD_NULL)
>>>     Passing "null" to function "org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createVolumeAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.CreateContext)", which dereferences
it.
130                 caller.setCallback(caller.getTarget().createVolumeAsyncCallback(null,
null));
131                 if (s_logger.isDebugEnabled()) {
132                     s_logger.debug("Downloading volume to data store " + dataStore.getId());
133                 }
134                 _downloadMonitor.downloadVolumeToStorage(data, caller);
135             }

** CID 1115375:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java:
116 in org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl.configure(java.lang.String,
java.util.Map)()


________________________________________________________________________________________________________
*** CID 1115375:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java:
116 in org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl.configure(java.lang.String,
java.util.Map)()
110             if (providers != null) {
111                 for (DataStoreProvider provider : providers) {
112                     registerProvider(provider);
113                 }
114             }
115     
>>>     CID 1115375:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "providers" to function "java.util.concurrent.CopyOnWriteArrayList.<init>(java.util.Collection)",
which dereferences it.
116             providers = new CopyOnWriteArrayList<DataStoreProvider>(providers);
117     
118             return true;
119         }
120     
121         protected boolean registerProvider(DataStoreProvider provider) {

** CID 1115439:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1115439:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java: 1159
in org.apache.cloudstack.storage.volume.VolumeServiceImpl.migrateVolumes(java.util.Map, com.cloud.agent.api.to.VirtualMachineTO,
com.cloud.host.Host, com.cloud.host.Host)()
1153                         volumesMigrating.add(volume);
1154                     }
1155                 }
1156     
1157                 MigrateVmWithVolumesContext<CommandResult> context = new MigrateVmWithVolumesContext<CommandResult>(null,
future, volumeMap);
1158                 AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> caller
= AsyncCallbackDispatcher.create(this);
>>>     CID 1115439:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing "null" to function "org.apache.cloudstack.storage.volume.VolumeServiceImpl.migrateVmWithVolumesCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
org.apache.cloudstack.storage.volume.VolumeServiceImpl.MigrateVmWithVolumesContext)", which
dereferences it.
1159                 caller.setCallback(caller.getTarget().migrateVmWithVolumesCallBack(null,
null)).setContext(context);
1160                 motionSrv.copyAsync(volumeMap, vmTo, srcHost, destHost, caller);
1161     
1162             } catch (Exception e) {
1163                 s_logger.debug("Failed to copy volume", e);
1164                 res.setResult(e.toString());


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/943?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
.


Mime
View raw message