From: Sandro Santilli Date: Thu, 9 May 2013 09:24:13 +0000 (+0000) Subject: Fix potential access to uninitialized value X-Git-Tag: 2.1.0beta2~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ee2b85a75995cbea578f477a8d66c48f8983474;p=postgis Fix potential access to uninitialized value It would have happened on malformed COMPOUNDCURVE (unlikely). Hushes compiler warning. git-svn-id: http://svn.osgeo.org/postgis/trunk@11387 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index fc01b13cb..8ff92e4cf 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -157,11 +157,15 @@ lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt) { /* Don't check closure while doing p-i-p test */ result = ptarray_contains_point_partial(lwline->points, pt, LW_FALSE, &winding_number); - } + } } - else if ( lwgeom->type == CIRCSTRINGTYPE ) + else { lwcirc = lwgeom_as_lwcircstring(lwgeom); + if ( ! lwcirc ) { + lwerror("Unexpected component of type %s in compound curve", lwtype_name(lwgeom->type)); + return 0; + } if ( comp->ngeoms == 1 ) { return ptarrayarc_contains_point(lwcirc->points, pt);