ArduPilot/ardupilot

AP_Param can set parameters by name which it shouldn't

Offen

#9.597 geöffnet am 22.10.2018

 (2 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C++ (15.603 Forks)batch import
good first issue

Repository-Metriken

Stars
 (9.336 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 26T 16h) (166 gemergte PRs in 30 T)

Beschreibung

Bug report

Issue details

The ArduSub tests currently pass when they probably shouldn't.

Version master Platform [ ] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ X ] Submarine

Airframe type Sub

Hardware type SITL

Reproduce with:

--- a/libraries/GCS_MAVLink/GCS_Param.cpp
+++ b/libraries/GCS_MAVLink/GCS_Param.cpp
@@ -329,6 +329,9 @@ void GCS::send_parameter_value(const char *param_name, ap_var_type param_type, f
         if ((1U<<i) & mavlink_active) {
             const mavlink_channel_t _chan = (mavlink_channel_t)(MAVLINK_COMM_0+i);
             if (HAVE_PAYLOAD_SPACE(_chan, PARAM_VALUE)) {
+                if (!strcmp(param_name, "ARMING_RUDDER")) {
+                    abort();
+                }
                 mavlink_msg_param_value_send(
                     _chan,
                     param_name,
pbarker@bluebottle:~/rc/ardupilot(master)$ 

./Tools/autotest/autotest.py --gdb --debug build.ArduSub dive.ArduSub

At that point in the code we've set the value in AP_Param when we shouldn't have.

We're not honouring check_frame_type in the find-by-name codepaths.

Contributor Guide