[vtk-developers] Fwd: New Defects reported by Coverity Scan for VTK

Ken Martin ken.martin at kitware.com
Mon May 16 10:10:46 EDT 2016


Not sure if everyone sees these, some new issues introduced - Ken


---------- Forwarded message ----------
From: <scan-admin at coverity.com>
Date: Fri, May 6, 2016 at 9:51 PM
Subject: New Defects reported by Coverity Scan for VTK
To: ken.martin at kitware.com



Hi,

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

3 new defect(s) introduced to VTK found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 1355146:  Null pointer dereferences  (NULL_RETURNS)
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx:
895 in vtkDataArray::InterpolateTuple(long long, long long,
vtkAbstractArray *, long long, vtkAbstractArray *, double)()


________________________________________________________________________________________________________
*** CID 1355146:  Null pointer dereferences  (NULL_RETURNS)
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx:
895 in vtkDataArray::InterpolateTuple(long long, long long,
vtkAbstractArray *, long long, vtkAbstractArray *, double)()
889         double in1;
890         double in2;
891         double out;
892         for (int c = 0; c < numComp; c++)
893           {
894           in1 = src1DA->GetComponent(srcTuple1, c);
>>>     CID 1355146:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "src2DA" when calling
"GetComponent". (The dereference happens because this is a virtual function
call.)
895           in2 = src2DA->GetComponent(srcTuple2, c);
896           out = in1 + t * (in2 - in1);
897           // Clamp to datatype range:
898           out = std::max(out, typeMin);
899           out = std::min(out, typeMax);
900           // Round if needed:

** CID 1355147:  Resource leaks  (RESOURCE_LEAK)
/home/nschloe/software/vtk/source-upstream/IO/XML/Testing/Cxx/TestXMLWriterWithDataArrayFallback.cxx:
32 in TestXMLWriterWithDataArrayFallback(int, char **)()


________________________________________________________________________________________________________
*** CID 1355147:  Resource leaks  (RESOURCE_LEAK)
/home/nschloe/software/vtk/source-upstream/IO/XML/Testing/Cxx/TestXMLWriterWithDataArrayFallback.cxx:
32 in TestXMLWriterWithDataArrayFallback(int, char **)()
26     #include "vtkXMLImageDataWriter.h"
27
28     #include <string>
29
30     int TestXMLWriterWithDataArrayFallback(int argc, char *argv[])
31     {
>>>     CID 1355147:  Resource leaks  (RESOURCE_LEAK)
>>>     Failing to save or free storage allocated by
"vtkTestUtilities::GetArgOrEnvOrDefault("-T", argc, argv, "VTK_TEMP_DIR",
"Testing/Temporary")" leaks it.
32       std::string temp_dir =
std::string(vtkTestUtilities::GetArgOrEnvOrDefault(
33                                            "-T", argc, argv,
"VTK_TEMP_DIR",
34                                            "Testing/Temporary"));
35       if (temp_dir.empty())
36         {
37         cerr << "Could not determine temporary directory." << endl;

** CID 1355148:  Null pointer dereferences  (REVERSE_INULL)
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx:
1310 in vtkDataArray::CreateDataArray(int)()


________________________________________________________________________________________________________
*** CID 1355148:  Null pointer dereferences  (REVERSE_INULL)
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx:
1310 in vtkDataArray::CreateDataArray(int)()
1304
1305
 //----------------------------------------------------------------------------
1306     vtkDataArray* vtkDataArray::CreateDataArray(int dataType)
1307     {
1308       vtkAbstractArray* aa = vtkAbstractArray::CreateArray(dataType);
1309       vtkDataArray* da = vtkDataArray::FastDownCast(aa);
>>>     CID 1355148:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "aa" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.
1310       if (!da && aa)
1311         {
1312         // Requested array is not a vtkDataArray. Delete the allocated
array.
1313         aa->Delete();
1314         }
1315       return da;


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

To manage Coverity Scan email notifications for "ken.martin at kitware.com",
click
https://scan.coverity.com/subscriptions/edit?email=ken.martin%40kitware.com&token=6c7b4acc71251964096addb92cdf7b72




-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160516/d62c8f01/attachment.html>


More information about the vtk-developers mailing list