From: david Date: Mon, 25 Mar 2002 20:05:34 +0000 (+0000) Subject: Patch from Melchior Franz: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b3d5d24d818856292c41bcfa9a1d8bf80e95a443;p=flightgear.git Patch from Melchior Franz: It seems that the airport database was changed some day and the End?Flags changed from floats to strings. The database definition, though, was not adapted and still created number entries. Reading out these flags led to access to memory, that was never initialized. While it didn't cause crashes during normal use, it actually caused one when I ran fgfs in ddd. Seems, that the concerned memory region wasn't zeroed out then and hence uncovered the bug. Of course, the runways.mk4 database has to be re-created with the new definitions. --- diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 75ad21984..b768ea61b 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -61,7 +61,7 @@ FGRunways::FGRunways( const string& file ) { vRunway = new c4_View; *vRunway = - storage->GetAs("runway[ID:S,Rwy:S,Longitude:F,Latitude:F,Heading:F,Length:F,Width:F,SurfaceFlags:S,End1Flags:F,End2Flags:F]"); + storage->GetAs("runway[ID:S,Rwy:S,Longitude:F,Latitude:F,Heading:F,Length:F,Width:F,SurfaceFlags:S,End1Flags:S,End2Flags:S]"); next_index = 0; } @@ -410,7 +410,6 @@ int FGRunwaysUtil::load( const string& file ) { // save the data in gdbm format bool FGRunwaysUtil::dump_mk4( const string& file ) { - // open database for writing c4_Storage storage( file.c_str(), true ); @@ -430,7 +429,7 @@ bool FGRunwaysUtil::dump_mk4( const string& file ) { // Start with an empty view of the proper structure. c4_View vRunway = - storage.GetAs("runway[ID:S,Rwy:S,Longitude:F,Latitude:F,Heading:F,Length:F,Width:F,SurfaceFlags:S,End1Flags:F,End2Flags:F]"); + storage.GetAs("runway[ID:S,Rwy:S,Longitude:F,Latitude:F,Heading:F,Length:F,Width:F,SurfaceFlags:S,End1Flags:S,End2Flags:S]"); c4_Row row;