Commit 7e769b0d authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'fix_for_xml_zero_read'

70b6bb3c fix case where nullptr passed to memcpy
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4517
parents bd1af9d9 70b6bb3c
......@@ -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