mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-14 23:43:43 -04:00
adsb: fix Coverity UNINIT_CTOR warning in AircraftModel
Initialize the AircraftModel settings pointer to nullptr. Coverity (CID 649096) flagged m_settings as potentially uninitialized because the compiler-generated constructor does not initialize it. Initialize it to nullptr, which is the appropriate default until setSettings() provides a valid pointer. This is likely not an issue, as m_settings is typically assigned shortly after construction. However, correctness depends on that assumption holding everywhere. Initializing it in the declaration costs nothing, removes the dependency on initialization order, and eliminates this class of bugs. Signed-off-by: Robin Getz <rgetz503@gmail.com>
This commit is contained in:
@@ -720,7 +720,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const ADSBDemodSettings *m_settings;
|
||||
const ADSBDemodSettings *m_settings = nullptr;
|
||||
|
||||
private:
|
||||
QList<Aircraft *> m_aircrafts;
|
||||
|
||||
Reference in New Issue
Block a user