pierr3 / TrackAudio

A next generation Audio-For-VATSIM ATC Client for macOS, Linux and Windows
Other
49 stars 11 forks source link

Adding a station that doesn't exist causes TrackAudio to crash #221

Open neilenns opened 1 day ago

neilenns commented 1 day ago

To reproduce:

  1. Connect TrackAudio
  2. Hit the add button
  3. Add SEA_RND as a station

Result: TrackAudio crashes Expected result: No crash, and either an error (preferred) or nothing.

neilenns commented 1 day ago

Callstack:

>   msvcp140d.dll!std::_Xout_of_range(const char * _Message) Line 23    C++
    trackaudio-afv.node!std::_String_val<std::_Simple_types<char>>::_Xran() Line 463    C++
    trackaudio-afv.node!std::_String_val<std::_Simple_types<char>>::_Check_offset(const unsigned __int64 _Off) Line 451 C++
    trackaudio-afv.node!std::string::basic_string<char,std::char_traits<char>,std::allocator<char>>(const std::string & _Right, const unsigned __int64 _Roff, const unsigned __int64 _Count, const std::allocator<char> & _Al) Line 718 C++
    trackaudio-afv.node!std::string::substr(const unsigned __int64 _Off, const unsigned __int64 _Count) Line 2811   C++
    trackaudio-afv.node!ns::Station::build(const std::string & callsign, int freqHz) Line 79    C++
    trackaudio-afv.node!SDK::handleAFVEventForWebsocket(sdk::types::Event event, const std::optional<std::string> & callsign, const std::optional<int> & frequencyHz) Line 145  C++
    trackaudio-afv.node!RadioHelper::SetRadioState(const std::shared_ptr<SDK> & mApiServer, const RadioState & newState, const std::string & stationCallsign) Line 71   C++
    trackaudio-afv.node!`anonymous namespace'::AddFrequency(const Napi::CallbackInfo & info) Line 202   C++
    trackaudio-afv.node!Napi::details::CallbackData<Napi::Boolean (__cdecl*)(Napi::CallbackInfo const &),Napi::Boolean>::Wrapper::__l2::<lambda>() Line 82  C++
    trackaudio-afv.node!Napi::details::WrapCallback<Napi::Boolean <lambda>(void)>(Napi::details::CallbackData<Napi::Boolean (__cdecl*)(Napi::CallbackInfo const &),Napi::Boolean>::Wrapper::__l2::Napi::Boolean <lambda>(void) callback) Line 61    C++
    trackaudio-afv.node!Napi::details::CallbackData<Napi::Boolean (__cdecl*)(Napi::CallbackInfo const &),Napi::Boolean>::Wrapper(napi_env__ * env, napi_callback_info__ * info) Line 84 C++