From: Sandro Santilli Date: Mon, 16 Jan 2012 09:11:38 +0000 (+0000) Subject: Prevent lwcollection_construct from creating non-collection types X-Git-Tag: 2.0.0alpha1~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=930da10769990996fba972d37fca1d4eac12060c;p=postgis Prevent lwcollection_construct from creating non-collection types git-svn-id: http://svn.osgeo.org/postgis/trunk@8826 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwcollection.c b/liblwgeom/lwcollection.c index 304f4ac0b..17d273061 100644 --- a/liblwgeom/lwcollection.c +++ b/liblwgeom/lwcollection.c @@ -39,6 +39,9 @@ lwcollection_construct(uint8_t type, int srid, GBOX *bbox, LWDEBUGF(2, "lwcollection_construct called with %d, %d, %p, %d, %p.", type, srid, bbox, ngeoms, geoms); + if( ! lwtype_is_collection(type) ) + lwerror("Non-collection type specified in collection constructor!"); + hasz = 0; hasm = 0; if ( ngeoms > 0 )