Opened 14 years ago

Closed 14 years ago

#3384 closed defect (fixed)

ogr2ogr crashes when converting SHP to MIF in version 1.70

Reported by: rhodges Owned by: chaitanya
Priority: high Milestone: 1.7.1
Component: OGR_SF Version: 1.7.0
Severity: blocker Keywords: mitab
Cc: Daniel Morissette, warmerdam, aboudreault


You should have no problem reproducing this, as the problem is a null pointer dereference on the return value of GetLayerDefn() from a newly created MIF layer. It appears that the MIF driver behaves differently than others in that it doesn't create this layer definition until you first start modifying it; unfortunately the new ogr2ogr code assumes that it will have done. I will attach a diff showing one way to defend against this, but perhaps you would prefer the approach of modifying the MIF driver instead -- I don't have enough familiarity with the code to feel confident attacking it from that angle.

Attachments (1)

ogr_diff.txt (2.7 KB ) - added by rhodges 14 years ago.
Diff showing one possible fix for this crash

Download all attachments as: .zip

Change History (4)

by rhodges, 14 years ago

Attachment: ogr_diff.txt added

Diff showing one possible fix for this crash

comment:1 by warmerdam, 14 years ago

Cc: Daniel Morissette warmerdam added
Component: defaultOGR_SF
Keywords: mitab added
Owner: changed from warmerdam to chaitanya


Could you look into this? You will need to cooperate with Daniel on changes that need to go upstream into mitab.

comment:2 by Daniel Morissette, 14 years ago

Cc: aboudreault added

comment:3 by Even Rouault, 14 years ago

Milestone: 1.7.1
Resolution: fixed
Status: newclosed


I've applied your patch in trunk (r18749) and in branches/1.7 (r18750) as a quick regression fix for it to go in time for 1.7.1. Tests added in r18751. Thanks !


I've opened ticket #3391 to track the fact that the MapInfo driver doesn't behave like other drivers.

Note: See TracTickets for help on using tickets.