mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 17:35:22 +08:00
motor_test: prevent use of uninitialised test_motor orb handle
stack variables are not initialised to zero
This commit is contained in:
@@ -59,9 +59,10 @@ __EXPORT int motor_test_main(int argc, char *argv[]);
|
||||
static void motor_test(unsigned channel, float value);
|
||||
static void usage(const char *reason);
|
||||
|
||||
static orb_advert_t _test_motor_pub;
|
||||
|
||||
void motor_test(unsigned channel, float value)
|
||||
{
|
||||
orb_advert_t _test_motor_pub;
|
||||
struct test_motor_s _test_motor;
|
||||
|
||||
_test_motor.motor_number = channel;
|
||||
|
||||
Reference in New Issue
Block a user