From b98d85c5e9856304cb7512c7b51555bdd72b22a7 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 4 Aug 2015 18:36:06 +0000 Subject: [PATCH] Fix unchecked return from _lwt_CheckEdgeCrossing (#3225) NOTE: only affects clients that do not long-jump out on lwerror (ie: PostGIS is unaffected) git-svn-id: http://svn.osgeo.org/postgis/trunk@13876 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwgeom_topo.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c index 44911c806..87c1eaef1 100644 --- a/liblwgeom/lwgeom_topo.c +++ b/liblwgeom/lwgeom_topo.c @@ -473,7 +473,7 @@ lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, /* Check that an edge does not cross an existing node or edge * - * Return -1 on cross, 0 if everything is fine. + * Return -1 on cross or error, 0 if everything is fine. * Note that before returning -1, lwerror is invoked... */ static int @@ -764,7 +764,10 @@ lwt_AddIsoEdge( LWT_TOPOLOGY* topo, LWT_ELEMID startNode, } if ( ! skipISOChecks ) - _lwt_CheckEdgeCrossing( topo, startNode, endNode, geom ); + { + if ( _lwt_CheckEdgeCrossing( topo, startNode, endNode, geom ) ) + return -1; + } /* * All checks passed, time to prepare the new edge @@ -2138,7 +2141,8 @@ _lwt_AddEdge( LWT_TOPOLOGY* topo, } } - _lwt_CheckEdgeCrossing( topo, start_node, end_node, geom ); + if ( _lwt_CheckEdgeCrossing( topo, start_node, end_node, geom ) ) + return -1; } /* ! skipChecks */ -- 2.40.0