From 06a14b4b27a61453865f96f043d11d798caa78c6 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 17 Aug 2020 16:05:20 +0100 Subject: [PATCH] Fix a use-after-free ASan spotted. --- src/Navaids/NavDataCache.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index a220bba5a..c6b93f635 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -2252,7 +2252,8 @@ NavDataCache::findAirportRunway(const std::string& aName) AirportRunwayPair result; sqlite_bind_stdstring(d->findAirportRunway, 1, parts[0]); - sqlite_bind_stdstring(d->findAirportRunway, 2, cleanRunwayNo(parts[1])); + const auto cleanedRunway = cleanRunwayNo(parts[1]); + sqlite_bind_stdstring(d->findAirportRunway, 2, cleanedRunway); if (d->execSelect(d->findAirportRunway)) { result = AirportRunwayPair(sqlite3_column_int64(d->findAirportRunway, 0),