mirror of https://github.com/ArduPilot/ardupilot
AP_Menu: zero buffer contents on allocation
This commit is contained in:
parent
470e5f570d
commit
46724db144
|
@ -202,8 +202,10 @@ Menu::_allocate_buffers(void)
|
||||||
/* only allocate if the buffers are NULL */
|
/* only allocate if the buffers are NULL */
|
||||||
if (_inbuf == NULL) {
|
if (_inbuf == NULL) {
|
||||||
_inbuf = new char[_commandline_max];
|
_inbuf = new char[_commandline_max];
|
||||||
|
memset(_inbuf, 0, _commandline_max);
|
||||||
}
|
}
|
||||||
if (_argv == NULL) {
|
if (_argv == NULL) {
|
||||||
_argv = new arg[_args_max+1];
|
_argv = new arg[_args_max+1];
|
||||||
|
memset(_argv, 0, (_args_max+1) * sizeof(_argv[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue