From 46724db14433ad4442e51edea7041a007d0b10eb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 Nov 2013 09:12:00 +1100 Subject: [PATCH] AP_Menu: zero buffer contents on allocation --- libraries/AP_Menu/AP_Menu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_Menu/AP_Menu.cpp b/libraries/AP_Menu/AP_Menu.cpp index 3c069b8456..160a422aef 100644 --- a/libraries/AP_Menu/AP_Menu.cpp +++ b/libraries/AP_Menu/AP_Menu.cpp @@ -202,8 +202,10 @@ Menu::_allocate_buffers(void) /* only allocate if the buffers are NULL */ if (_inbuf == NULL) { _inbuf = new char[_commandline_max]; + memset(_inbuf, 0, _commandline_max); } if (_argv == NULL) { _argv = new arg[_args_max+1]; + memset(_argv, 0, (_args_max+1) * sizeof(_argv[0])); } }