From 92dffd412a6028d6d07c360853a2101b72a7277b 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 7e4bb4e8d..2653e409a 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -191,7 +191,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