Hi,
Please find the latest report on new defect(s) introduced to cloudstack found
with Coverity Scan.
17 new defect(s) introduced to cloudstack found with Coverity Scan.
9 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 17 of 17 defect(s)
** CID 1115476: Explicit null dereferenced (FORWARD_NULL)
** CID 1115475: Explicit null dereferenced (FORWARD_NULL)
** CID 1115478: Explicit null dereferenced (FORWARD_NULL)
** CID 1115464: Explicit null dereferenced (FORWARD_NULL)
** CID 1115438: Explicit null dereferenced (FORWARD_NULL)
** CID 1115437: Explicit null dereferenced (FORWARD_NULL)
** CID 1115922: Explicit null dereferenced (FORWARD_NULL)
** CID 1115921: Explicit null dereferenced (FORWARD_NULL)
** CID 1115919: Explicit null dereferenced (FORWARD_NULL)
** CID 1115075: Explicit null dereferenced (FORWARD_NULL)
** CID 1116418: Dereference null return value (NULL_RETURNS)
/server/src/com/cloud/template/TemplateManagerImpl.java: 1387 in
com.cloud.template.TemplateManagerImpl.createPrivateTemplate(org.apache.cloudstack.api.command.user.template.CreateTemplateCmd)()
** CID 1116368: Dereference null return value (NULL_RETURNS)
/server/src/com/cloud/template/TemplateManagerImpl.java: 1036 in
com.cloud.template.TemplateManagerImpl.attachISOToVM(long, long, boolean)()
** CID 1125350: Explicit null dereferenced (FORWARD_NULL)
** CID 1153007: Explicit null dereferenced (FORWARD_NULL)
** CID 1191675: Explicit null dereferenced (FORWARD_NULL)
** CID 1194809: Dereference null return value (NULL_RETURNS)
/framework/rest/src/org/apache/cloudstack/framework/ws/jackson/CSJacksonAnnotationIntrospector.java:
45 in
org.apache.cloudstack.framework.ws.jackson.CSJacksonAnnotationIntrospector.findSerializer(com.fasterxml.jackson.databind.introspect.Annotated)()
** CID 1233058: Explicit null dereferenced (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1115476: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
868 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.copyVolumeFromImageToPrimary(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
862 destVolume = (VolumeInfo)destStore.create(srcVolume);
863 destVolume.processEvent(Event.CopyingRequested);
864 srcVolume.processEvent(Event.CopyingRequested);
865
866 CopyVolumeContext<VolumeApiResult> context = new
CopyVolumeContext<VolumeApiResult>(null, future, srcVolume, destVolume,
destStore);
867 AsyncCallbackDispatcher<VolumeServiceImpl,
CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115476: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.copyVolumeFromImageToPrimaryCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.CopyVolumeContext)",
>>> which dereferences it.
868
caller.setCallback(caller.getTarget().copyVolumeFromImageToPrimaryCallback(null,
null)).setContext(context);
869
870 motionSrv.copyAsync(srcVolume, destVolume, caller);
871 return future;
872 } catch (Exception e) {
873 s_logger.error("failed to copy volume from image store", e);
________________________________________________________________________________________________________
*** CID 1115475: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
923 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.copyVolumeFromPrimaryToImage(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
917 destVolume = (VolumeInfo)destStore.create(srcVolume);
918 srcVolume.processEvent(Event.MigrationRequested); //
this is just used for locking that src volume record in DB to avoid using lock
919 destVolume.processEventOnly(Event.CreateOnlyRequested);
920
921 CopyVolumeContext<VolumeApiResult> context = new
CopyVolumeContext<VolumeApiResult>(null, future, srcVolume, destVolume,
destStore);
922 AsyncCallbackDispatcher<VolumeServiceImpl,
CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115475: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.copyVolumeFromPrimaryToImageCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.CopyVolumeContext)",
>>> which dereferences it.
923
caller.setCallback(caller.getTarget().copyVolumeFromPrimaryToImageCallback(null,
null)).setContext(context);
924
925 motionSrv.copyAsync(srcVolume, destVolume, caller);
926 return future;
927 } catch (Exception e) {
928 s_logger.error("failed to copy volume to image store", e);
________________________________________________________________________________________________________
*** CID 1115478: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
199 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.createVolumeAsync(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
193 DataObject volumeOnStore = dataStore.create(volume);
194 volumeOnStore.processEvent(Event.CreateOnlyRequested);
195
196 try {
197 CreateVolumeContext<VolumeApiResult> context = new
CreateVolumeContext<VolumeApiResult>(null, volumeOnStore, future);
198 AsyncCallbackDispatcher<VolumeServiceImpl, CreateCmdResult>
caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115478: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.createVolumeCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.CreateVolumeContext)",
>>> which dereferences it.
199
caller.setCallback(caller.getTarget().createVolumeCallback(null,
null)).setContext(context);
200
201 dataStore.getDriver().createAsync(dataStore, volumeOnStore,
caller);
202 } catch (CloudRuntimeException ex) {
203 // clean up already persisted volume_store_ref entry in
case of createVolumeCallback is never called
204 VolumeDataStoreVO volStoreVO =
_volumeStoreDao.findByStoreVolume(dataStore.getId(), volume.getId());
________________________________________________________________________________________________________
*** CID 1115464: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java:
659 in
org.apache.cloudstack.storage.image.TemplateServiceImpl.syncToRegionStoreAsync(org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
653 String installPath =
654 TemplateConstants.DEFAULT_TMPLT_ROOT_DIR + "/" +
TemplateConstants.DEFAULT_TMPLT_FIRST_LEVEL_DIR + template.getAccountId() + "/"
+ template.getId() + "/" +
655 template.getUniqueName();
656 ((TemplateObject)templateOnStore).setInstallPath(installPath);
657 TemplateOpContext<TemplateApiResult> context = new
TemplateOpContext<TemplateApiResult>(null, (TemplateObject)templateOnStore,
future);
658 AsyncCallbackDispatcher<TemplateServiceImpl, CopyCommandResult>
caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115464: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.image.TemplateServiceImpl.syncTemplateCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.image.TemplateServiceImpl.TemplateOpContext)",
>>> which dereferences it.
659
caller.setCallback(caller.getTarget().syncTemplateCallBack(null,
null)).setContext(context);
660 _motionSrv.copyAsync(template, templateOnStore, caller);
661 return future;
662 }
663
664 protected Void
syncTemplateCallBack(AsyncCallbackDispatcher<TemplateServiceImpl,
CopyCommandResult> callback, TemplateOpContext<TemplateApiResult> context) {
________________________________________________________________________________________________________
*** CID 1115438: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
1081 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.migrateVolume(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
1075 }
1076
1077 VolumeInfo destVolume =
volFactory.getVolume(srcVolume.getId(), destStore);
1078 srcVolume.processEvent(Event.MigrationRequested);
1079 MigrateVolumeContext<VolumeApiResult> context = new
MigrateVolumeContext<VolumeApiResult>(null, future, srcVolume, destVolume,
destStore);
1080 AsyncCallbackDispatcher<VolumeServiceImpl,
CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115438: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.migrateVolumeCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.MigrateVolumeContext)",
>>> which dereferences it.
1081
caller.setCallback(caller.getTarget().migrateVolumeCallBack(null,
null)).setContext(context);
1082 motionSrv.copyAsync(srcVolume, destVolume, caller);
1083 } catch (Exception e) {
1084 s_logger.debug("Failed to copy volume", e);
1085 res.setResult(e.toString());
1086 future.complete(res);
________________________________________________________________________________________________________
*** CID 1115437: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
1208 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.registerVolume(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
1202
1203 volumeOnStore.processEvent(Event.CreateOnlyRequested);
1204
1205 try {
1206 CreateVolumeContext<VolumeApiResult> context = new
CreateVolumeContext<VolumeApiResult>(null, volumeOnStore, future);
1207 AsyncCallbackDispatcher<VolumeServiceImpl,
CreateCmdResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115437: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.registerVolumeCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.CreateVolumeContext)",
>>> which dereferences it.
1208
caller.setCallback(caller.getTarget().registerVolumeCallback(null, null));
1209 caller.setContext(context);
1210
1211 store.getDriver().createAsync(store, volumeOnStore,
caller);
1212 } catch (CloudRuntimeException ex) {
1213 // clean up already persisted volume_store_ref entry in
case of createVolumeCallback is never called
________________________________________________________________________________________________________
*** CID 1115922: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java:
196 in
org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.takeSnapshot(org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo)()
190 }
191
192 AsyncCallFuture<SnapshotResult> future = new
AsyncCallFuture<SnapshotResult>();
193 try {
194 CreateSnapshotContext<CommandResult> context = new
CreateSnapshotContext<CommandResult>(null, snap.getBaseVolume(),
snapshotOnPrimary, future);
195 AsyncCallbackDispatcher<SnapshotServiceImpl,
CreateCmdResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115922: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.createSnapshotAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.CreateSnapshotContext)",
>>> which dereferences it.
196
caller.setCallback(caller.getTarget().createSnapshotAsyncCallback(null,
null)).setContext(context);
197 PrimaryDataStoreDriver primaryStore =
(PrimaryDataStoreDriver)snapshotOnPrimary.getDataStore().getDriver();
198 primaryStore.takeSnapshot(snapshot, caller);
199 } catch (Exception e) {
200 s_logger.debug("Failed to take snapshot: " +
snapshot.getId(), e);
201 try {
________________________________________________________________________________________________________
*** CID 1115921: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java:
266 in
org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.backupSnapshot(org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo)()
260
261 SnapshotInfo snapshotOnImageStore =
(SnapshotInfo)imageStore.create(snapshot);
262
263
snapshotOnImageStore.processEvent(Event.CreateOnlyRequested);
264 CopySnapshotContext<CommandResult> context = new
CopySnapshotContext<CommandResult>(null, snapshot, snapshotOnImageStore,
future);
265 AsyncCallbackDispatcher<SnapshotServiceImpl,
CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115921: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.copySnapshotAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.CopySnapshotContext)",
>>> which dereferences it.
266
caller.setCallback(caller.getTarget().copySnapshotAsyncCallback(null,
null)).setContext(context);
267 motionSrv.copyAsync(snapshot, snapshotOnImageStore, caller);
268 } catch (Exception e) {
269 s_logger.debug("Failed to copy snapshot", e);
270 result.setResult("Failed to copy snapshot:" + e.toString());
271 try {
________________________________________________________________________________________________________
*** CID 1115919: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java:
414 in
org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.revertSnapshot(java.lang.Long)()
408 SnapshotInfo snapshot =
_snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Primary);
409 PrimaryDataStore store =
(PrimaryDataStore)snapshot.getDataStore();
410
411 AsyncCallFuture<SnapshotResult> future = new
AsyncCallFuture<SnapshotResult>();
412 RevertSnapshotContext<CommandResult> context = new
RevertSnapshotContext<CommandResult>(null, snapshot, future);
413 AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult>
caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115919: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.revertSnapshotCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.RevertSnapshotContext)",
>>> which dereferences it.
414
caller.setCallback(caller.getTarget().revertSnapshotCallback(null,
null)).setContext(context);
415
416
((PrimaryDataStoreDriver)store.getDriver()).revertSnapshot(snapshot, caller);
417
418 SnapshotResult result = null;
419 try {
________________________________________________________________________________________________________
*** CID 1115075: Explicit null dereferenced (FORWARD_NULL)
/server/src/com/cloud/template/HypervisorTemplateAdapter.java: 179 in
com.cloud.template.HypervisorTemplateAdapter.create(com.cloud.storage.TemplateProfile)()
173
174 }
175
176 TemplateInfo tmpl =
imageFactory.getTemplate(template.getId(), imageStore);
177 CreateTemplateContext<TemplateApiResult> context = new
CreateTemplateContext<TemplateApiResult>(null, tmpl);
178 AsyncCallbackDispatcher<HypervisorTemplateAdapter,
TemplateApiResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1115075: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "com.cloud.template.HypervisorTemplateAdapter.createTemplateAsyncCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>> com.cloud.template.HypervisorTemplateAdapter.CreateTemplateContext)",
>>> which dereferences it.
179
caller.setCallback(caller.getTarget().createTemplateAsyncCallBack(null, null));
180 caller.setContext(context);
181 imageService.createTemplateAsync(tmpl, imageStore, caller);
182 }
183
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(),
ResourceType.template);
184
________________________________________________________________________________________________________
*** CID 1116418: Dereference null return value (NULL_RETURNS)
/server/src/com/cloud/template/TemplateManagerImpl.java: 1387 in
com.cloud.template.TemplateManagerImpl.createPrivateTemplate(org.apache.cloudstack.api.command.user.template.CreateTemplateCmd)()
1381 if (snapshotId != null) {
1382 DataStoreRole dataStoreRole =
getDataStoreRole(snapshot);
1383
1384 SnapshotInfo snapInfo =
_snapshotFactory.getSnapshot(snapshotId, dataStoreRole);
1385
1386 if (dataStoreRole == DataStoreRole.Image) {
>>> CID 1116418: Dereference null return value (NULL_RETURNS)
>>> Calling a method on null object "snapInfo".
1387 DataStore snapStore = snapInfo.getDataStore();
1388
1389 if (snapStore != null) {
1390 store = snapStore; // pick snapshot image
store to create template
1391 }
1392 }
________________________________________________________________________________________________________
*** CID 1116368: Dereference null return value (NULL_RETURNS)
/server/src/com/cloud/template/TemplateManagerImpl.java: 1036 in
com.cloud.template.TemplateManagerImpl.attachISOToVM(long, long, boolean)()
1030 HostVO host = _hostDao.findById(vm.getHostId());
1031 if (host == null) {
1032 s_logger.warn("Host: " + vm.getHostId() + " does not
exist");
1033 return false;
1034 }
1035
>>> CID 1116368: Dereference null return value (NULL_RETURNS)
>>> Calling a method on null object "tmplt".
1036 DataTO isoTO = tmplt.getTO();
1037 DiskTO disk = new DiskTO(isoTO, null, null, Volume.Type.ISO);
1038 Command cmd = null;
1039 if (attach) {
1040 cmd = new AttachCommand(disk, vmName);
1041 } else {
________________________________________________________________________________________________________
*** CID 1125350: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
601 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.createVolumeFromBaseImageAsync(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject,
org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore,
org.apache.cloudstack.framework.async.AsyncCallFuture)()
595 DataObject volumeOnPrimaryStorage = pd.create(volume);
596 volumeOnPrimaryStorage.processEvent(Event.CreateOnlyRequested);
597
598 CreateVolumeFromBaseImageContext<VolumeApiResult> context =
599 new
CreateVolumeFromBaseImageContext<VolumeApiResult>(null, volumeOnPrimaryStorage,
pd, templateOnPrimaryStore, future, null);
600 AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult>
caller = AsyncCallbackDispatcher.create(this);
>>> CID 1125350: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.createVolumeFromBaseImageCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.CreateVolumeFromBaseImageContext)",
>>> which dereferences it.
601
caller.setCallback(caller.getTarget().createVolumeFromBaseImageCallBack(null,
null));
602 caller.setContext(context);
603
604 motionSrv.copyAsync(context.templateOnStore,
volumeOnPrimaryStorage, caller);
605 return;
606 }
________________________________________________________________________________________________________
*** CID 1153007: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java:
515 in
org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.syncToRegionStoreAsync(org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo,
org.apache.cloudstack.engine.subsystem.api.storage.DataStore)()
509 + snapshot.getAccountId() + "/" +
snapshot.getVolumeId();
510 ((SnapshotObject)snapshotOnStore).setPath(installPath);
511 CopySnapshotContext<CommandResult> context = new
CopySnapshotContext<CommandResult>(null, snapshot,
512 snapshotOnStore, future);
513 AsyncCallbackDispatcher<SnapshotServiceImpl, CopyCommandResult>
caller = AsyncCallbackDispatcher
514 .create(this);
>>> CID 1153007: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.syncSnapshotCallBack(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.CopySnapshotContext)",
>>> which dereferences it.
515
caller.setCallback(caller.getTarget().syncSnapshotCallBack(null,
null)).setContext(context);
516 motionSrv.copyAsync(snapshot, snapshotOnStore, caller);
517 return future;
518 }
519
520 protected Void
syncSnapshotCallBack(AsyncCallbackDispatcher<SnapshotServiceImpl,
CopyCommandResult> callback,
________________________________________________________________________________________________________
*** CID 1191675: Explicit null dereferenced (FORWARD_NULL)
/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
684 in
org.apache.cloudstack.storage.volume.VolumeServiceImpl.createManagedStorageAndVolumeFromTemplateAsync(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo,
long, org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo, long)()
678
679 grantAccess(volumeInfo, destHost, destPrimaryDataStore);
680
681 ManagedCreateBaseImageContext<CreateCmdResult> context =
new ManagedCreateBaseImageContext<CreateCmdResult>(null, volumeInfo,
682 destPrimaryDataStore, srcTemplateInfo, future);
683 AsyncCallbackDispatcher<VolumeServiceImpl,
CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
>>> CID 1191675: Explicit null dereferenced (FORWARD_NULL)
>>> Passing "null" to function
>>> "org.apache.cloudstack.storage.volume.VolumeServiceImpl.managedCopyBaseImageCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
>>>
>>> org.apache.cloudstack.storage.volume.VolumeServiceImpl.ManagedCreateBaseImageContext)",
>>> which dereferences it.
684
caller.setCallback(caller.getTarget().managedCopyBaseImageCallback(null,
null)).setContext(context);
685
686 Map<String, String> details = new HashMap<String, String>();
687
688 details.put(PrimaryDataStore.MANAGED,
Boolean.TRUE.toString());
689 details.put(PrimaryDataStore.STORAGE_HOST,
destPrimaryDataStore.getHostAddress());
________________________________________________________________________________________________________
*** CID 1194809: Dereference null return value (NULL_RETURNS)
/framework/rest/src/org/apache/cloudstack/framework/ws/jackson/CSJacksonAnnotationIntrospector.java:
45 in
org.apache.cloudstack.framework.ws.jackson.CSJacksonAnnotationIntrospector.findSerializer(com.fasterxml.jackson.databind.introspect.Annotated)()
39 return new Version(1, 7, 0, "abc", "org.apache.cloudstack",
"cloudstack-framework-rest");
40 }
41
42 @Override
43 public Object findSerializer(Annotated a) {
44 AnnotatedElement ae = a.getAnnotated();
>>> CID 1194809: Dereference null return value (NULL_RETURNS)
>>> Calling a method on null object "ae".
45 Url an = ae.getAnnotation(Url.class);
46 if (an == null) {
47 return null;
48 }
49
50 if (an.type() == String.class) {
________________________________________________________________________________________________________
*** CID 1233058: Explicit null dereferenced (FORWARD_NULL)
/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java:
94 in
org.apache.cloudstack.storage.datastore.driver.SwiftImageStoreDriverImpl.createAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject,
org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
88
89 CreateContext<CreateCmdResult> context = new
CreateContext<CreateCmdResult>(callback, data);
90 AsyncCallbackDispatcher<SwiftImageStoreDriverImpl,
DownloadAnswer> caller = AsyncCallbackDispatcher.create(this);
91 caller.setContext(context);
92
93 if (data.getType() == DataObjectType.TEMPLATE) {
>>> CID 1233058: Explicit null dereferenced (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.
94
caller.setCallback(caller.getTarget().createTemplateAsyncCallback(null, null));
95 } else if (data.getType() == DataObjectType.VOLUME) {
96
caller.setCallback(caller.getTarget().createVolumeAsyncCallback(null, null));
97 }
98 ep.sendMessageAsync(dcmd, caller);
99
100 }
101
/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java:
96 in
org.apache.cloudstack.storage.datastore.driver.SwiftImageStoreDriverImpl.createAsync(org.apache.cloudstack.engine.subsystem.api.storage.DataStore,
org.apache.cloudstack.engine.subsystem.api.storage.DataObject,
org.apache.cloudstack.framework.async.AsyncCompletionCallback)()
90 AsyncCallbackDispatcher<SwiftImageStoreDriverImpl,
DownloadAnswer> caller = AsyncCallbackDispatcher.create(this);
91 caller.setContext(context);
92
93 if (data.getType() == DataObjectType.TEMPLATE) {
94
caller.setCallback(caller.getTarget().createTemplateAsyncCallback(null, null));
95 } else if (data.getType() == DataObjectType.VOLUME) {
>>> CID 1233058: Explicit null dereferenced (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.
96
caller.setCallback(caller.getTarget().createVolumeAsyncCallback(null, null));
97 }
98 ep.sendMessageAsync(dcmd, caller);
99
100 }
101
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
http://scan.coverity.com/projects/943?tab=overview
To manage Coverity Scan email notifications for "[email protected]",
click
http://scan.coverity.com/subscriptions/edit?email=dev%40cloudstack.apache.org&token=494aabd5ba647999fa41b6d766646231
.