ArduPilot/ardupilot

AP_Param can set parameters by name which it shouldn't

开放

#9,597 创建于 2018年10月22日

 (2 条评论) (0 个反应) (1 位负责人)C++ (15,603 个派生)batch import
good first issue

仓库指标

星标
 (9,336 个星标)
PR 合并指标
 (平均合并 26天 16小时) (30 天内合并 166 个 PR)

描述

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.

贡献者指南