mavlink: protect against uninitialized fields on mavlink_message_t
mavlink: protect against uninitialized fields on mavlink_message_t

At least one of the mavlink API functions would not work well with
unitialized fields of that struct -- mavlink_msg_home_position_get_z():

      CC   build/stage/modules/pin-mux/intel-edison-rev-c/intel-edison-rev-c.o
./src/lib/comms/sol-mavlink.c: In function ‘sol_mavlink_fd_handler’:
./src/lib/comms/sol-mavlink.c:423:12: warning: ‘*((void *)&msg+28)’ may be used uninitialized in thi
s function [-Wmaybe-uninitialized]
     pos->z = mavlink_msg_home_position_get_z(msg);
            ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘*((void *)&msg+28)’ was declared here
     mavlink_message_t msg;
                       ^
In file included from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/ardupilotme
ga.h:30:0,
                 from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/mavlink.h:2
5,
                 from ./src/lib/comms/sol-mavlink.c:36:
<...>/soletta/src/thirdparty/mavlink/ardupilotmega/../protocol.h:281:95: warning: ‘*
((void *)&msg+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/lib/comms/sol-mavlink.c:439:23: note: ‘*((void *)&msg+24)’ was declared here
     mavlink_message_t msg;
                       ^
In file included from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/ardupilotme
ga.h:30:0,
                 from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/mavlink.h:2
5,
                 from ./src/lib/comms/sol-mavlink.c:36:
<...>/soletta/src/thirdparty/mavlink/ardupilotmega/../protocol.h:281:95: warning: ‘*
((void *)&msg+20)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/lib/comms/sol-mavlink.c:439:23: note: ‘*((void *)&msg+20)’ was declared here
     mavlink_message_t msg;
                       ^
./src/lib/comms/sol-mavlink.c:393:13: warning: ‘*((void *)&msg+16)’ may be used uninitialized in thi
s function [-Wmaybe-uninitialized]
     if (lat != pos->latitude || longi != pos->longitude || alt != pos->altitude) {
             ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘*((void *)&msg+16)’ was declared here
     mavlink_message_t msg;
                       ^
./src/lib/comms/sol-mavlink.c:258:14: warning: ‘*((void *)&msg+8)’ may be used uninitialized in this
 function [-Wmaybe-uninitialized]
         mode = mavlink_msg_heartbeat_get_custom_mode(msg);
              ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘*((void *)&msg+8)’ was declared here
     mavlink_message_t msg;
                       ^
./src/lib/comms/sol-mavlink.c:460:9: warning: ‘msg.msgid’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]
         switch (msg.msgid) {
         ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘msg.msgid’ was declared here
     mavlink_message_t msg;
                       ^
In file included from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/../protocol
.h:85:0,
                 from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/ardupilotme
ga.h:30,
                 from <...>/soletta/src/thirdparty/mavlink/ardupilotmega/mavlink.h:2
5,
                 from ./src/lib/comms/sol-mavlink.c:36:
<...>/soletta/src/thirdparty/mavlink/ardupilotmega/../mavlink_helpers.h:79:14: warni
ng: ‘msg.compid’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  msg->compid = component_id;
              ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘msg.compid’ was declared here
     mavlink_message_t msg;
                       ^
./src/lib/comms/sol-mavlink.c:365:38: warning: ‘msg.sysid’ may be used uninitialized in this functio
n [-Wmaybe-uninitialized]
     if (mavlink->sysid != msg->sysid || mavlink->compid != msg->sysid)
                                      ^
./src/lib/comms/sol-mavlink.c:439:23: note: ‘msg.sysid’ was declared here
     mavlink_message_t msg;

Closes gh-1453

Signed-off-by: Gustavo Lima Chaves <dc5f5719afbf9af3fe162a3ac398146b4d0a4afe@intel.com>

bdilly/soletta,edersondisouza/soletta,wzhen12/soletta,tripzero/soletta,zolkis/soletta,gabrielschulhof/soletta,bsmelo/soletta,brunobottazzini/soletta,barbieri/soletta,brunobottazzini/soletta,wzhen12/soletta,ibriano/soletta,cabelitos/soletta,barbieri/soletta,lpereira/soletta,barbieri/soletta,otaviobp/soletta,cabelitos/soletta,zolkis/soletta,bsmelo/soletta,ibriano/soletta,bdilly/soletta,edersondisouza/soletta,brunobottazzini/soletta,edersondisouza/soletta,otaviobp/soletta,tripzero/soletta,lpereira/soletta,nagineni/soletta,nagineni/soletta,zolkis/soletta,ibriano/soletta,tripzero/soletta,barbieri/soletta,bsmelo/soletta,bsmelo/soletta,bsmelo/soletta,zolkis/soletta,otaviobp/soletta,wzhen12/soletta,tripzero/soletta,wanghongjuan/soletta,edersondisouza/soletta,dorileo/soletta,bdilly/soletta,wanghongjuan/soletta,tripzero/soletta,bdilly/soletta,cabelitos/soletta,wzhen12/soletta,otaviobp/soletta,ibriano/soletta,ibriano/soletta,dorileo/soletta,barbieri/soletta,gabrielschulhof/soletta,gabrielschulhof/soletta,edersondisouza/soletta,ibriano/soletta,wanghongjuan/soletta,brunobottazzini/soletta,wzhen12/soletta,lpereira/soletta,barbieri/soletta,otaviobp/soletta,nagineni/soletta,brunobottazzini/soletta,nagineni/soletta,zolkis/soletta,bdilly/soletta,dorileo/soletta,brunobottazzini/soletta,cabelitos/soletta,gabrielschulhof/soletta,bsmelo/soletta,gabrielschulhof/soletta,wanghongjuan/soletta,edersondisouza/soletta,tripzero/soletta,cabelitos/soletta,wanghongjuan/soletta,nagineni/soletta,lpereira/soletta,wzhen12/soletta,wanghongjuan/soletta,dorileo/soletta,dorileo/soletta,cabelitos/soletta,lpereira/soletta,gabrielschulhof/soletta,dorileo/soletta,otaviobp/soletta