aboutsummaryrefslogtreecommitdiff
path: root/src/systemcmds
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2014-11-20 09:52:50 +1100
committerAndrew Tridgell <tridge@samba.org>2014-11-26 08:32:47 +1100
commitecc7a3cbb42f6490b43f21b3849738184934a2a0 (patch)
tree42a05216a0ccd02049212170f34aceeab76ea602 /src/systemcmds
parentb830137ec8492dc583b61689b7d56a1b359a5c5b (diff)
downloadpx4-firmware-ecc7a3cbb42f6490b43f21b3849738184934a2a0.tar.gz
px4-firmware-ecc7a3cbb42f6490b43f21b3849738184934a2a0.tar.bz2
px4-firmware-ecc7a3cbb42f6490b43f21b3849738184934a2a0.zip
motor_test: prevent use of uninitialised test_motor orb handle
stack variables are not initialised to zero
Diffstat (limited to 'src/systemcmds')
-rw-r--r--src/systemcmds/motor_test/motor_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/systemcmds/motor_test/motor_test.c b/src/systemcmds/motor_test/motor_test.c
index 1b7ff75f7..77dc2f0d5 100644
--- a/src/systemcmds/motor_test/motor_test.c
+++ b/src/systemcmds/motor_test/motor_test.c
@@ -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;