From 930da10769990996fba972d37fca1d4eac12060c Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 16 Jan 2012 09:11:38 +0000 Subject: [PATCH] Prevent lwcollection_construct from creating non-collection types git-svn-id: http://svn.osgeo.org/postgis/trunk@8826 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwcollection.c | 3 +++ 1 file changed, 3 insertions(+) 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 ) -- 2.40.0