ArduPilot/ardupilot

AP_Param can set parameters by name which it shouldn't

Open

#9,597 opened on Oct 22, 2018

View on GitHub
 (2 comments) (0 reactions) (1 assignee)C++ (15,603 forks)batch import
good first issue

Repository metrics

Stars
 (9,336 stars)
PR merge metrics
 (Avg merge 26d 16h) (166 merged PRs in 30d)

Description

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