#3436 closed defect (fixed)

Memory mistake in ptarray_clone_deep

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.2
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

The clone sets the npoints and maxpoints of the output to match the input, but only allocates npoints worth of space. So if points are added to the clone after the operation, Bad Things Happen.

SELECT ST_GeomFromKML('<MultiGeometry>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>121.50835,22.632916 121.508331,22.63293 121.50828,22.632937 121.508257,22.632941 121.508231,22.632968 121.508207,22.63298 121.508174,22.632989 121.508131,22.63298 121.508091,22.632967 121.508055,22.632928 121.508007,22.632852 121.507976,22.632741 121.507979,22.632604 121.50799,22.632572 121.508011,22.632542 121.508144,22.632436 121.508168,22.632427 121.508192,22.632425 121.508219,22.632427 121.508237,22.632436 121.508329,22.632537 121.508334,22.63256 121.508324,22.632578 121.508254,22.632632 121.508239,22.632652 121.508232,22.632677 121.508214,22.63272 121.508193,22.632725 121.508153,22.632723 121.508114,22.632732 121.508095,22.63275 121.508091,22.632773 121.508095,22.632791 121.508112,22.632813 121.508141,22.632833 121.508185,22.632842 121.508226,22.632835 121.508308,22.632806 121.508344,22.632808 121.50837,22.632819 121.508386,22.632835 121.508391,22.632862
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>');

Change History (1)

comment:1 Changed 21 months ago by pramsey

Resolution: fixed
Status: newclosed

Fixed in 2.0 at r14607, 2.1 at r14608, 2.2 at r14609, trunk at r14610.

Note: See TracTickets for help on using tickets.