Opened 19 years ago

Closed 17 years ago

#1366 closed defect (fixed)

I fixed a bug in mapxbase.c that was causing sortshp to core dump

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

Description (last modified by hobu)

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

Attachments (1)

mapxbase.c (31.7 KB ) - added by mharnoldx@… 19 years ago.
mabxbase.c with my fix.

Download all attachments as: .zip

Change History (2)

by mharnoldx@…, 19 years ago

Attachment: mapxbase.c added

mabxbase.c with my fix.

comment:1 by hobu, 17 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

It appears this has been fixed at r4564

Note: See TracTickets for help on using tickets.