[fdo-trac] #815: Ordinates is not released by FdoIMultiPoint when
the geometry is reused
FDO
trac_fdo at osgeo.org
Fri Feb 10 17:17:18 EST 2012
#815: Ordinates is not released by FdoIMultiPoint when the geometry is reused
--------------------------------+-------------------------------------------
Reporter: romicadascalescu | Owner: romicadascalescu
Type: defect | Status: new
Priority: major | Milestone: 3.7.0
Component: FDO API | Version: 3.7.0
Severity: 2 | Keywords:
External_id: |
--------------------------------+-------------------------------------------
FDO is recycling the geometries and also the byte arrays used by
geometries.
FDO is doing that by calling Reset() on the geometry (see below).
Now the ordinates pointer was not cleaned up for multi-points (a pointer
to a memory location having points coordinates). Depending of the number
of points of the old geometry and the number of points of the new
geometry, and in case the recycled geometry had less points than the new
one, FDO was writing more points in ordinates buffer than it should
(ordinates pointer was nor reallocated to reflect the new bigger
geometry). This way FDO corrupted memory, sometimes less critical (and
crash occurred later), sometimes critical and crash showed up as a heap
corruption
void FdoFgfMultiPoint::Reset(
FdoByteArray * byteArray,
const FdoByte * data,
FdoInt32 count
)
{
// new code begin
if (m_ordinates != NULL)
delete[] m_ordinates;
m_ordinates = NULL;
// new code end
SetFgf(byteArray, data, count);
}
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/815>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list