Opened 20 years ago
Closed 19 years ago
#791 closed defect (fixed)
Mapxbase.c : uninit variable in msDBF Create crashes msDBFClose
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer C Library | Version: | 4.2 |
Severity: | normal | Keywords: | |
Cc: |
Description
In mapserver-4.2.1 distribution, Mapxbase.c Symptom: A DBF file is created using msDBFCreate(). When it is closed by msDBFClose(), msDBFClose crashes with a segmentation violation at the statement: if(psDBF->pszStringField)free(psDBF->StringField); indicating that psDBF->pszStringField is (a) not null, and (b) does not have a "proper" value. Cause: psDBF->pszStringField is not initialized by msDBFCreate(), and gets a rubbish value on my Sun Solaris 8 system when compiling, etc., with gcc 2.95.3. Solution: Add psDBF->pszStringField = NULL; within msDBFCreate(). psDBF->nStringFieldLen and psDBF->bUpdated are not initialized either; perhaps they should be?
Change History (2)
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I concur. the pszStringField, nStringFieldLen and bUpdated are now initialized in 4.5.
Note:
See TracTickets
for help on using tickets.