<div dir="ltr">Not sure if everyone sees these, some new issues introduced - Ken<div><br></div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a>></span><br>Date: Fri, May 6, 2016 at 9:51 PM<br>Subject: New Defects reported by Coverity Scan for VTK<br>To: <a href="mailto:ken.martin@kitware.com">ken.martin@kitware.com</a><br><br><br><br>
Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to VTK found with Coverity Scan.<br>
<br>
3 new defect(s) introduced to VTK found with Coverity Scan.<br>
<br>
<br>
New defect(s) Reported-by: Coverity Scan<br>
Showing 3 of 3 defect(s)<br>
<br>
<br>
** CID 1355146:  Null pointer dereferences  (NULL_RETURNS)<br>
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx: 895 in vtkDataArray::InterpolateTuple(long long, long long, vtkAbstractArray *, long long, vtkAbstractArray *, double)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1355146:  Null pointer dereferences  (NULL_RETURNS)<br>
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx: 895 in vtkDataArray::InterpolateTuple(long long, long long, vtkAbstractArray *, long long, vtkAbstractArray *, double)()<br>
889         double in1;<br>
890         double in2;<br>
891         double out;<br>
892         for (int c = 0; c < numComp; c++)<br>
893           {<br>
894           in1 = src1DA->GetComponent(srcTuple1, c);<br>
>>>     CID 1355146:  Null pointer dereferences  (NULL_RETURNS)<br>
>>>     Dereferencing a pointer that might be null "src2DA" when calling "GetComponent". (The dereference happens because this is a virtual function call.)<br>
895           in2 = src2DA->GetComponent(srcTuple2, c);<br>
896           out = in1 + t * (in2 - in1);<br>
897           // Clamp to datatype range:<br>
898           out = std::max(out, typeMin);<br>
899           out = std::min(out, typeMax);<br>
900           // Round if needed:<br>
<br>
** CID 1355147:  Resource leaks  (RESOURCE_LEAK)<br>
/home/nschloe/software/vtk/source-upstream/IO/XML/Testing/Cxx/TestXMLWriterWithDataArrayFallback.cxx: 32 in TestXMLWriterWithDataArrayFallback(int, char **)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1355147:  Resource leaks  (RESOURCE_LEAK)<br>
/home/nschloe/software/vtk/source-upstream/IO/XML/Testing/Cxx/TestXMLWriterWithDataArrayFallback.cxx: 32 in TestXMLWriterWithDataArrayFallback(int, char **)()<br>
26     #include "vtkXMLImageDataWriter.h"<br>
27<br>
28     #include <string><br>
29<br>
30     int TestXMLWriterWithDataArrayFallback(int argc, char *argv[])<br>
31     {<br>
>>>     CID 1355147:  Resource leaks  (RESOURCE_LEAK)<br>
>>>     Failing to save or free storage allocated by "vtkTestUtilities::GetArgOrEnvOrDefault("-T", argc, argv, "VTK_TEMP_DIR", "Testing/Temporary")" leaks it.<br>
32       std::string temp_dir = std::string(vtkTestUtilities::GetArgOrEnvOrDefault(<br>
33                                            "-T", argc, argv, "VTK_TEMP_DIR",<br>
34                                            "Testing/Temporary"));<br>
35       if (temp_dir.empty())<br>
36         {<br>
37         cerr << "Could not determine temporary directory." << endl;<br>
<br>
** CID 1355148:  Null pointer dereferences  (REVERSE_INULL)<br>
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx: 1310 in vtkDataArray::CreateDataArray(int)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1355148:  Null pointer dereferences  (REVERSE_INULL)<br>
/home/nschloe/software/vtk/source-upstream/Common/Core/vtkDataArray.cxx: 1310 in vtkDataArray::CreateDataArray(int)()<br>
1304<br>
1305     //----------------------------------------------------------------------------<br>
1306     vtkDataArray* vtkDataArray::CreateDataArray(int dataType)<br>
1307     {<br>
1308       vtkAbstractArray* aa = vtkAbstractArray::CreateArray(dataType);<br>
1309       vtkDataArray* da = vtkDataArray::FastDownCast(aa);<br>
>>>     CID 1355148:  Null pointer dereferences  (REVERSE_INULL)<br>
>>>     Null-checking "aa" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.<br>
1310       if (!da && aa)<br>
1311         {<br>
1312         // Requested array is not a vtkDataArray. Delete the allocated array.<br>
1313         aa->Delete();<br>
1314         }<br>
1315       return da;<br>
<br>
<br>
________________________________________________________________________________________________________<br>
To view the defects in Coverity Scan visit, <a href="https://scan.coverity.com/projects/vtk?tab=overview" rel="noreferrer" target="_blank">https://scan.coverity.com/projects/vtk?tab=overview</a><br>
<br>
To manage Coverity Scan email notifications for "<a href="mailto:ken.martin@kitware.com">ken.martin@kitware.com</a>", click <a href="https://scan.coverity.com/subscriptions/edit?email=ken.martin%40kitware.com&token=6c7b4acc71251964096addb92cdf7b72" rel="noreferrer" target="_blank">https://scan.coverity.com/subscriptions/edit?email=ken.martin%40kitware.com&token=6c7b4acc71251964096addb92cdf7b72</a><br>
<br>
</div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">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.</span></div></div></div>
</div></div>