Hi,

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

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


** CID 1324347:  Null pointer dereferences  (NULL_RETURNS)
/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java:
 359 in 
org.apache.cloudstack.storage.template.DownloadManagerImpl.postRemoteDownload(java.lang.String)()


________________________________________________________________________________________________________
*** CID 1324347:  Null pointer dereferences  (NULL_RETURNS)
/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java:
 359 in 
org.apache.cloudstack.storage.template.DownloadManagerImpl.postRemoteDownload(java.lang.String)()
353     
354             if (td.getFileExtension().equalsIgnoreCase("QCOW2")) {
355                 // The QCOW2 is the only format with a header,
356                 // and as such can be easily read.
357     
358                 try {
>>>     CID 1324347:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "inputStream" = null return value from 
>>> "com.cloud.storage.template.S3TemplateDownloader.getS3ObjectInputStream()".
359                     InputStream inputStream = td.getS3ObjectInputStream();
360     
361                     
dnld.setTemplatesize(QCOW2Utils.getVirtualSize(inputStream));
362     
363                     inputStream.close();
364                 }

** CID 1324349:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java:
 242 in 
org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createVolumeAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
 org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl$CreateContext)()


________________________________________________________________________________________________________
*** CID 1324349:  Null pointer dereferences  (FORWARD_NULL)
/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java:
 242 in 
org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createVolumeAsyncCallback(org.apache.cloudstack.framework.async.AsyncCallbackDispatcher,
 org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl$CreateContext)()
236                 answer.getDownloadStatus() == 
VMTemplateStorageResourceAssoc.Status.ABANDONED || answer.getDownloadStatus() 
== VMTemplateStorageResourceAssoc.Status.UNKNOWN) {
237                 CreateCmdResult result = new CreateCmdResult(null, null);
238                 result.setSuccess(false);
239                 result.setResult(answer.getErrorString());
240                 caller.complete(result);
241                 String msg = "Failed to upload volume: " + obj.getUuid() + 
" with error: " + answer.getErrorString();
>>>     CID 1324349:  Null pointer dereferences  (FORWARD_NULL)
>>>     Calling a method on null object "volStoreVO".
242                 
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_UPLOAD_FAILED, 
volStoreVO.getZoneId(), null, msg, msg);
243                 s_logger.error(msg);
244             } else if (answer.getDownloadStatus() == 
VMTemplateStorageResourceAssoc.Status.DOWNLOADED) {
245                 CreateCmdResult result = new CreateCmdResult(null, null);
246                 caller.complete(result);
247             }

** CID 1324350:  FindBugs: Bad practice  
(FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
/agent/src/com/cloud/agent/Agent.java: 767 in 
com.cloud.agent.Agent$WatchTask.runInContext()()


________________________________________________________________________________________________________
*** CID 1324350:  FindBugs: Bad practice  
(FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
/agent/src/com/cloud/agent/Agent.java: 767 in 
com.cloud.agent.Agent$WatchTask.runInContext()()
761             protected void runInContext() {
762                 if (s_logger.isTraceEnabled()) {
763                     s_logger.trace("Scheduling " + (_request instanceof 
Response ? "Ping" : "Watch Task"));
764                 }
765                 try {
766                     if (_request instanceof Response) {
>>>     CID 1324350:  FindBugs: Bad practice  
>>> (FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
>>>     exceptional return value of 
>>> java.util.concurrent.AbstractExecutorService.submit(Callable) ignored
767                         _ugentTaskPool.submit(new 
ServerHandler(Task.Type.OTHER, _link, _request));
768                     } else {
769                         _link.schedule(new ServerHandler(Task.Type.OTHER, 
_link, _request));
770                     }
771                 } catch (final ClosedChannelException e) {
772                     s_logger.warn("Unable to schedule task because channel 
is closed");

** CID 1324351:  FindBugs: Bad practice  
(FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
/agent/src/com/cloud/agent/Agent.java: 851 in 
com.cloud.agent.Agent$ServerHandler.doTask(com.cloud.utils.nio.Task)()


________________________________________________________________________________________________________
*** CID 1324351:  FindBugs: Bad practice  
(FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
/agent/src/com/cloud/agent/Agent.java: 851 in 
com.cloud.agent.Agent$ServerHandler.doTask(com.cloud.utils.nio.Task)()
845                         if (request instanceof Response) {
846                             //It's for pinganswer etc, should be processed 
immediately.
847                             processResponse((Response)request, 
task.getLink());
848                         } else {
849                             //put the requests from mgt server into another 
thread pool, as the request may take a longer time to finish. Don't block the 
NIO main thread pool
850                             //processRequest(request, task.getLink());
>>>     CID 1324351:  FindBugs: Bad practice  
>>> (FB.RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)
>>>     exceptional return value of 
>>> java.util.concurrent.ExecutorService.submit(Callable) ignored
851                             _executor.submit(new 
AgentRequestHandler(getType(), getLink(), request));
852                         }
853                     } catch (final ClassNotFoundException e) {
854                         s_logger.error("Unable to find this request ");
855                     } catch (final Exception e) {
856                         s_logger.error("Error parsing task", e);

** CID 1324352:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java:
 426 in 
org.apache.cloudstack.storage.template.DownloadManagerImpl.postLocalDownload(java.lang.String)()


________________________________________________________________________________________________________
*** CID 1324352:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java:
 426 in 
org.apache.cloudstack.storage.template.DownloadManagerImpl.postLocalDownload(java.lang.String)()
420             // add options common to ISO and template
421             String extension = dnld.getFormat().getFileExtension();
422             String templateName = "";
423             if (extension.equals("iso")) {
424                 templateName = 
jobs.get(jobId).getTmpltName().trim().replace(" ", "_");
425             } else {
>>>     CID 1324352:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
>>>     Found reliance on default encoding: String.getBytes()
426                 templateName = 
java.util.UUID.nameUUIDFromBytes((jobs.get(jobId).getTmpltName() + 
System.currentTimeMillis()).getBytes()).toString();
427             }
428     
429             // run script to mv the temporary template file to the final 
template
430             // file
431             String templateFilename = templateName + "." + extension;


________________________________________________________________________________________________________
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