Fix memory exception in LWGEOM_GEOS_makeValidCollection #21

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@ahuarte47

No description provided.

@ahuarte47 ahuarte47 Fix memory exception in LWGEOM_GEOS_makeValidCollection
3afad52
@strk
Member
strk commented Jun 26, 2014

What's the point of this patch ? The "vgeoms" variable is lwfree-d right after passing it to GEOSGeom_createCollection, less code for the same result

@strk strk closed this Jun 26, 2014
@ahuarte47

Te code is calling GEOSGeom_destroy(vgeoms[i]); after free vgeoms

@strk strk reopened this Jun 26, 2014
@strk
Member
strk commented Jun 26, 2014

Ah! Good catch.
Do you also have an actual dataset triggering that ?

@ahuarte47

No, I am sorry, I saw it studing the code for QGIS issues

@strk strk closed this Jun 26, 2014
@ahuarte47

Thanks to you Sandro!

@ahuarte47 ahuarte47 deleted the ahuarte47:Issue_makeValidCollection branch Jun 26, 2014
@strk strk pushed a commit that referenced this pull request Jun 26, 2014
Sandro Santilli Fix potential memory fault in ST_MakeValid
The fault would be triggered by passing a non-empty collection
to ST_MakeValid where any "made-valid" component would result
being non accepted by the final geometry collection constructor.

I'm not sure an input exists right now to trigger that case,
but worth fixing anyway.

Bug found by Alvaro Huarte:
#21

git-svn-id: http://svn.osgeo.org/postgis/branches/2.1@12667 b70326c6-7e19-0410-871a-916f4a2858ee
2ff161c
@strk strk pushed a commit that referenced this pull request Jun 26, 2014
Sandro Santilli Fix potential memory fault in ST_MakeValid
The fault would be triggered by passing a non-empty collection
to ST_MakeValid where any "made-valid" component would result
being non accepted by the final geometry collection constructor.

I'm not sure an input exists right now to trigger that case,
but worth fixing anyway.

Bug found by Alvaro Huarte:
#21

git-svn-id: http://svn.osgeo.org/postgis/trunk@12666 b70326c6-7e19-0410-871a-916f4a2858ee
7b0155a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment