Opened 12 years ago

Closed 12 years ago

#815 closed defect (fixed)

Ordinates is not released by FdoIMultiPoint when the geometry is reused

Reported by: romicadascalescu Owned by: romicadascalescu
Priority: major Milestone: 3.7.0
Component: FDO API Version: 3.7.0
Severity: 2 Keywords:
Cc: External ID:

Description

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);

}

Change History (1)

comment:1 by romicadascalescu, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.