Skip to content

Commit

Permalink
FlatGeoBuf: fix potential nullptr dereference. Fixes https://bugs.chr…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 24, 2019
1 parent 5dadb24 commit 9d8e1a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gdal/ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ OGRFlatGeobufLayer::OGRFlatGeobufLayer(const Header *poHeader, GByte *headerBuf,
} else if( org && code != 0 ) {
CPLString osCode;
osCode.Printf("%s:%d", org->c_str(), code);
if( m_poSRS->SetFromUserInput(osCode.c_str()) != OGRERR_NONE )
if( m_poSRS->SetFromUserInput(osCode.c_str()) != OGRERR_NONE &&
wkt != nullptr )
{
m_poSRS->importFromWkt(wkt->c_str());
}
} else if (wkt) {
m_poSRS->importFromWkt(wkt->c_str());
}
Expand Down

0 comments on commit 9d8e1a9

Please sign in to comment.