Browse Source

SITL: avoid use of uninitialised memory

master
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
eb6826f7de
  1. 3
      libraries/AP_HAL_SITL/sitl_gps.cpp

3
libraries/AP_HAL_SITL/sitl_gps.cpp

@ -355,6 +355,9 @@ void SITL_State::_update_gps_ubx(const struct gps_data *d) @@ -355,6 +355,9 @@ void SITL_State::_update_gps_ubx(const struct gps_data *d)
pvt.s_acc = 40;
pvt.head_acc = 38 * 1.0e5;
pvt.p_dop = 65535;
memset(pvt.reserved1, '\0', ARRAY_SIZE(pvt.reserved1));
pvt.headVeh = 0;
memset(pvt.reserved2, '\0', ARRAY_SIZE(pvt.reserved2));
_gps_send_ubx(MSG_POSLLH, (uint8_t*)&pos, sizeof(pos));
_gps_send_ubx(MSG_STATUS, (uint8_t*)&status, sizeof(status));

Loading…
Cancel
Save