Commit 36ad2819 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri Committed by Code Review

Merge topic 'fix_buffer_overflow' into master

37615d26 BUG: Fix buffer overflow in vtkPUnstructuredGridConnectivity
parents a00ef388 37615d26
......@@ -658,8 +658,8 @@ void vtkPUnstructuredGridConnectivity::BuildGhostZoneConnectivity()
if(this->GlobalIDFieldName == NULL)
{
// We assume "GlobalID" as the default
this->GlobalIDFieldName = new char[8];
strcpy(this->GlobalIDFieldName,"GlobalID");
this->GlobalIDFieldName = new char[9];
strncpy(this->GlobalIDFieldName,"GlobalID", 9);
}
// STEP 0: Ensure the input grid has GlobalID information
......@@ -1058,7 +1058,7 @@ void vtkPUnstructuredGridConnectivity::SerializeGhostZones()
// serialize the global IDs s.t. the remote rank knows which node to
// update once the data is transferred.
bytestream.Push(&globalIdx[0],nodelinks->size());
bytestream.Push(&globalIdx[0],static_cast<unsigned int>(nodelinks->size()));
// serialize the selected tuples for this remote rank
vtkFieldDataSerializer::SerializeTuples(tupleIds,PD,bytestream);
......
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