Ticket #1366 (closed defect: fixed)

Opened 8 years ago

Last modified 6 years ago

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) (diff)

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

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

Change History

Changed 8 years ago by mharnoldx@…

mabxbase.c with my fix.

Changed 6 years ago by hobu

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

It appears this has been fixed at r4564

Note: See TracTickets for help on using tickets.