java-topology/whitepaper/outreach/flightgear-0001.md
russell@unturf.com 652608142a feat: close outreach doc gap — 276 docs (batches 11-16)
All projects with patches now have outreach docs. 276 new docs covering
CWE-407, CWE-312, CWE-362 across C, C++, Java, Python, Go, Rust, C#,
PHP, Ruby, JavaScript, Dart, Erlang, R, and more.

Outreach gap: 276 -> 0.
2026-04-15 13:57:42 -04:00

2 KiB

FlightGear — CWE-407 Disclosure Brief (flightgear-0001)

2026-04-13 · Patch available — awaiting upstream merge

Finding

One O(N^2) defect in FlightGear's ground network node deduplication during airport loading. Patched. Patch ready for upstream review.

The Defects

flightgear-0001 (PATCHED — MEDIUM): src/Airports/groundnetwork.cxx:558

// In addSegment() and addParking() — fire during airport ground network loading:
FGTaxiNodeVector::iterator it = std::find(m_nodes.begin(), m_nodes.end(), from);
if (it == m_nodes.end()) {
    m_nodes.push_back(from);
}

m_nodes is a std::vector<FGTaxiNodeRef>. std::find performs O(N) linear scan for each node addition. With N nodes in the ground network, loading costs O(N^2).

Complexity Proof

At N=500 taxi nodes:

  • Defective: 500 x 500 / 2 = 125,000 comparisons
  • Fixed: 500 x 1 = 500 lookups (unordered_set)
  • 250x op reduction.

Impact

FlightGear loads ground networks for airports. Large airports (KJFK, EGLL, EDDF) have hundreds of taxi nodes and segments. The O(N^2) dedup fires during every airport load.

The Fix

Add an std::unordered_set<FGTaxiNode*> m_nodeSet alongside the vector:

// Before
std::find(m_nodes.begin(), m_nodes.end(), from) == m_nodes.end()

// After
m_nodeSet.find(from.get()) == m_nodeSet.end()

Patch

Fix available: defects/flightgear-0001/patch/flightgear-0001.patch

Two-file patch across groundnetwork.hxx and groundnetwork.cxx. 250x speedup at N=500 taxi nodes.

What We Ask

A patch is ready for review.

  1. Confirm receipt and assign a SourceForge/GitLab issue reference (FlightGear).
  2. Assess severity — fires during airport loading; scales with ground network size.
  3. Coordinate a disclosure date — we are targeting 90 days from first contact.
  4. We will credit the FlightGear team in the public disclosure. Preferred acknowledgment format welcome.

Contact: see cover email. This brief is confidential until coordinated disclosure.