AP_Menu: zero buffer contents on allocation

This commit is contained in:
Andrew Tridgell 2013-11-06 09:12:00 +11:00 committed by Randy Mackay
parent a24e3b555e
commit ff5ddde905

View File

@ -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]));
}
}