Dynamics_RegularTwoTrack: Unchecked parameter access can cause undefined behavior
File sim/src/components/Dynamics_RegularTwoTrack/dynamics_regularTwoTrack.cpp
In DynamicsRegularTwoTrackImplementation::Init()
several values are accessed through parameter maps, without proper checking for existence.
Example: radiusTire.SetValue(parameterMapDoubleExternal.find(radiusTire")->second);
Issue: If the key is missing, find
delivers std::end(parameterMapDoubleExternal)
and ->second
accesses some arbitrary value right after the memory or the map.
Solution: The parameters should come from recently introduced VehicleModelParameters
Note: This issue might also affect the Dynamics_TwoTrack module (https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/issues/36)