Opened 19 years ago

Last modified 17 years ago

#1366 closed defect

I fixed a bug in mapxbase.c that was causing sortshp to core dump — at Initial Version

Reported by: mharnoldx@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer C Library Version: 4.4
Severity: normal Keywords:
Cc:

Description

Thanks for mapserver!  I am having lots of fun with it.

I found (and fixed) the following small bug in mapxbase.c

I've got:
mapserver version 4.4.1
MS_CVSID("$Id: mapxbase.c,v 1.18 2004/10/21 04:30:54 frank Exp $")

The following initializations were missing from msDBFCreate()
    psDBF->pszStringField = NULL;
    psDBF->nStringFieldLen = 0;    

This caused sortshp to core dump in DBFClose() trying to free a garbage
pszStringField pointer.

I also changed the allocation from malloc() to calloc() as in MSDBFOpen()
fust to be safe.

I'll be glad to mail you my modified source file (just tell me where
to send it!)

Cheers,
Michael Arnold

P.S.  I also added maplib.a to the sortshp dependencies in Makefile

Change History (1)

by mharnoldx@…, 19 years ago

Attachment: mapxbase.c added

mabxbase.c with my fix.

Note: See TracTickets for help on using tickets.