]> granicus.if.org Git - postgis/commitdiff
Prevent lwcollection_construct from creating non-collection types
authorSandro Santilli <strk@keybit.net>
Mon, 16 Jan 2012 09:11:38 +0000 (09:11 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 16 Jan 2012 09:11:38 +0000 (09:11 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8826 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwcollection.c

index 304f4ac0b380322c711d229b69d0ca73c9305197..17d273061c2377312a78e38a8b9864535606b360 100644 (file)
@@ -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 )