shell: utils: Fix buffer overrun in shell_spaces_trim
The third argument in memmove can possible be greater than remaining buffer size. Just ensuring that memmove will changes bytes only inside the string buffer and nothing else. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
c97e1aafb1
commit
a2872c3a00
1 changed files with 1 additions and 1 deletions
|
@ -413,7 +413,7 @@ void shell_spaces_trim(char *str)
|
|||
/* +1 for EOS */
|
||||
memmove(&str[i + 1],
|
||||
&str[j],
|
||||
len - shift + 1);
|
||||
len - j + 1);
|
||||
len -= shift;
|
||||
shift = 0U;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue