[postgis-users] Bug in postgis/lwgeom_geos_prepared.c

Paragon Corporation lr at pcorp.us
Mon Apr 22 12:02:57 PDT 2013


Side note, might be better to move these discussions to postgis-develop .  I
assume most PostGIS devs read PostGIS users but may be distracting for
PostGIS users these

C code discussions. Besides strk feels lonely on PostGIS-dev :)

Just my 2cents,
Regina
http://www.postgis.us
http://postgis.net



-----Original Message-----
From: postgis-users-bounces at lists.osgeo.org
[mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Stephen
Woodbridge
Sent: Monday, April 22, 2013 1:12 PM
To: postgis-users at lists.osgeo.org
Subject: Re: [postgis-users] Bug in postgis/lwgeom_geos_prepared.c

http://trac.osgeo.org/postgis/ticket/2277

On 4/22/2013 1:04 PM, Stephen Woodbridge wrote:
> In reading through the code in "postgis/lwgeom_geos_prepared.c" I have 
> noticed a bug that you probably should fix:
>
> static void
> DeletePrepGeomHashEntry(MemoryContext mcxt) {
>      void **key;
>      PrepGeomHashEntry *he;
>
>      /* The hash key is the MemoryContext pointer */
>      key = (void *)&mcxt;
>
>      /* Delete the projection object from the hash */
>      he = (PrepGeomHashEntry *) hash_search(PrepGeomHash, key, 
> HASH_REMOVE, NULL);
>
>      he->prepared_geom = NULL;
>      he->geom = NULL;
>
>      if (!he)
>          elog(ERROR, "DeletePrepGeomHashEntry: There was an error 
> removing the geometry object from this MemoryContext (%p)", (void 
> *)mcxt); }
>
>
> Notice that  if he == NULL, you will never get to the if (!he) 
> statement because you will have already segv'd on the prior two 
> statements trying to access he.

_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users




More information about the postgis-users mailing list