Opened 20 years ago

Closed 20 years ago

#604 closed defect (fixed)

Dangling pointers in layerinfo (mappostgis.c, msPOSTGISLayerOpen())

Reported by: frank.koormann@… Owned by: refractions
Priority: high Milestone:
Component: PostGIS Interface Version: 3.6
Severity: normal Keywords:
Cc: frank.koormann@…

Description

Hi,

3.6.7 tarball version contains a severe bug in the PostGIS Interface:
Opening a layer with msPOSTGISLayerOpen() not all pointers of the layerinfo
struct are initialised properly. This seems to be done usually later (e.g. in
prepDB) but in combination with maplab (queries) I encountered situations where 
msPOSTGISLayerClose() is called before all pointers are well initialised.
Especially layerinfo->urid_name is a dangling pointer, the NULL check fails and 
the following free causes a segfault. 

Thus is fixed in 4.x series, however the attached patch might be of some use for
3.6.7 users.

Frank

Attachments (1)

ms3.6.7_mappostgis.patch (586 bytes ) - added by frank.koormann@… 20 years ago.
Patch fixes bug #604

Download all attachments as: .zip

Change History (2)

by frank.koormann@…, 20 years ago

Attachment: ms3.6.7_mappostgis.patch added

Patch fixes bug #604

comment:1 by dmorissette, 20 years ago

Resolution: fixed
Status: newclosed
Summary: Dangling pointers in layerinfo (mappostgis.c, msPOSTGISLayerOpen()) Dangling pointers in layerinfo (mappostgis.c, msPOSTGISLayerOpen())
We are unlikely to ever release another 3.6.x version, but I have applied your
patch (untested) to the 3.6.x branch anyway so that we can close this bug (and
in case anyone gets that version from CVS).
Note: See TracTickets for help on using tickets.