From 5a7ee5a376853b5034a92b7a58655df880760bcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Apr 2021 12:17:07 +1000 Subject: [PATCH] AP_Common: fixed null termination bug in ExpandingString not all HALs zero memory on realloc --- libraries/AP_Common/ExpandingString.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_Common/ExpandingString.cpp b/libraries/AP_Common/ExpandingString.cpp index bbb7473d0b..33a18daf6b 100644 --- a/libraries/AP_Common/ExpandingString.cpp +++ b/libraries/AP_Common/ExpandingString.cpp @@ -43,6 +43,7 @@ bool ExpandingString::expand(uint32_t min_extra_space_needed) buflen = newsize; buf = (char *)newbuf; + memset(&buf[used], 0, newsize-used); return true; }