Commit 70b6bb3c authored by Ken Martin's avatar Ken Martin

fix case where nullptr passed to memcpy

minor dynamic analysis warning, memcpy passed null but
size to copy was zero as well
parent 591dee99
......@@ -981,7 +981,8 @@ void vtkXMLReader::ReadFieldData()
}
fieldData->AddArray(array);
array->Delete();
if (!this->ReadArrayValues(eNested, 0, array, 0, numTuples*array->GetNumberOfComponents()))
if (!this->ReadArrayValues(eNested, 0, array, 0, numTuples*array->GetNumberOfComponents())
&& numTuples)
{
this->DataError = 1;
}
......
......@@ -896,7 +896,10 @@ size_t vtkXMLDataParser::ReadAsciiData(void* buffer,
this->UpdateProgress(0.5);
// Copy the data from the pre-parsed ascii data buffer.
memcpy(buffer, this->AsciiDataBuffer+startByte, actualBytes);
if (buffer && actualBytes)
{
memcpy(buffer, this->AsciiDataBuffer+startByte, actualBytes);
}
this->UpdateProgress(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment