ArduPilot/ardupilot

AP_Param can set parameters by name which it shouldn't

Aperta

#9597 aperta il 22 ott 2018

 (2 commenti) (0 reazioni) (1 assegnatario)C++ (15.603 fork)batch import
good first issue

Metriche repository

Star
 (9336 stelle)
Metriche merge PR
 (Merge medio 26g 16h) (166 PR mergiate in 30 g)

Descrizione

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.

Guida contributor