From f453372736741c4bc19f75baf214661c4bc14dcc Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 26 Aug 2015 13:26:09 -0400 Subject: [PATCH] fix buffer overflow --- src/comm/MAVLinkProtocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index e122d5778..30bef6498 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -189,7 +189,7 @@ void MAVLinkProtocol::_linkStatusChanged(LinkInterface* link, bool connected) // Send command to start MAVLink // XXX hacky but safe // Start NSH - const char init[] = {0x0d, 0x0d, 0x0d}; + const char init[] = {0x0d, 0x0d, 0x0d, 0x0d}; link->writeBytes(init, sizeof(init)); const char* cmd = "sh /etc/init.d/rc.usb\n"; link->writeBytes(cmd, strlen(cmd)); -- 2.22.0