[MOAB-dev] r5302 - MOAB/trunk/src
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Tue Jan 10 17:15:58 CST 2012
Author: tautges
Date: 2012-01-10 17:15:57 -0600 (Tue, 10 Jan 2012)
New Revision: 5302
Modified:
MOAB/trunk/src/DenseTag.cpp
Log:
Bad pointer arithmetic, uncovered by building on Intrepid.
Modified: MOAB/trunk/src/DenseTag.cpp
===================================================================
--- MOAB/trunk/src/DenseTag.cpp 2012-01-10 18:30:42 UTC (rev 5301)
+++ MOAB/trunk/src/DenseTag.cpp 2012-01-10 23:15:57 UTC (rev 5302)
@@ -125,9 +125,10 @@
ErrorCode DenseTag::get_array( const EntitySequence* seq,
const unsigned char* const& ptr) const
{
- const void* mem = seq->data()->get_tag_data( mySequenceArray );
- if (mem)
- mem += get_size() * (seq->start_handle() - seq->data()->start_handle());
+ ptr = reinterpret_cast<unsigned char*>(seq->data()->get_tag_data( mySequenceArray ));
+ if (ptr)
+ ptr += get_size() * (seq->start_handle() - seq->data()->start_handle());
+
return MB_SUCCESS;
}
More information about the moab-dev
mailing list