ArduPilot/ardupilot

AP_Param can set parameters by name which it shouldn't

Ouverte

#9 597 ouverte le 22 oct. 2018

 (2 commentaires) (0 réaction) (1 personne assignée)C++ (15 603 forks)batch import
good first issue

Métriques du dépôt

Stars
 (9 336 étoiles)
Métriques de merge PR
 (Merge moyen 26j 16h) (166 PRs mergées en 30 j)

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.

Guide contributeur