From 5d8b4c1e23f15773790252912f9be3600f0f3c5e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2018 14:41:16 +1000 Subject: [PATCH] HAL_ChibiOS: ensure system_id is nul terminated --- libraries/AP_HAL_ChibiOS/Util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/Util.cpp b/libraries/AP_HAL_ChibiOS/Util.cpp index 4d0ce6207a..af3fc7a01f 100644 --- a/libraries/AP_HAL_ChibiOS/Util.cpp +++ b/libraries/AP_HAL_ChibiOS/Util.cpp @@ -261,6 +261,7 @@ bool Util::get_system_id(char buf[40]) board_name, (unsigned)serialid[3], (unsigned)serialid[2], (unsigned)serialid[1], (unsigned)serialid[0], (unsigned)serialid[7], (unsigned)serialid[6], (unsigned)serialid[5], (unsigned)serialid[4], - (unsigned)serialid[11], (unsigned)serialid[10], (unsigned)serialid[9],(unsigned)serialid[8]); + (unsigned)serialid[11], (unsigned)serialid[10], (unsigned)serialid[9],(unsigned)serialid[8]); + buf[39] = 0; return true; }