Mapscript 4.10.0 and 4.10.2 gives segfault with Postgres 8.2 [SEC=UNCLASSIFIED]

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Wed Jul 4 04:41:31 EDT 2007


Roppola, Antti - BRS wrote:
> Hi all,
>  
> We're in the process of upgrading from 4.8.1 to 4.10.2 and we are seeing 
> segfaults
> when using PostGIS layers. I've had a look through the bug tracker and 
> source, the main
> difference between msPOSTGISLayerRetrievePK() between 4.8.1 and 4.10.2 
> appears
> to be the following (mappostgis.c revisions 1.66 to 1.77):

Antti,

yes, this looks indeed like a bug in msPOSTGISLayerRetrievePK to me. 
I've had a look at the code and I could spot line 1770 of mappostgis.c 
(Mapserver 4.10.1, line number might vary slightly in other versions) 
which doesn't really look very effective:

       length = (int)pos_sep + strlen(pos_sep);

Casting a pointer into an int doesn't seem to make any sense here. I'd 
suggest you change that line to

       length = strlen(pos_sep);

recompile and try again.

Best regards,
-- 
--------------------------------------------------------------------
Andreas Albarello
Analysis & SW Development

Territorium Online srl/GmbH
Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
email: andreas.albarello at territoriumonline.com
web:   www.territoriumonline.com
--------------------------------------------------------------------



More information about the mapserver-users mailing list