Parent: 99abc8a9e1e1d256749e519a1758bf9a8576c468
Author: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-08-26 16:30:01
Tree: a8a50e0e0b1f255033a1920ef13c867b97347dc1
lib: Fix out-of-bounds write when concatenating commands This commit fixes the hci_commandstostr() command by writing new line character in place of trailing space when wrapping long lines. Previous approach was to append new line character to existing string, which caused buffer overflow when there was more than 9 lines in the output string. Also, the last trailing space is removed in order to return trailing-spaces-free string to the caller.
Diffstat
| M | lib/bluetooth/hci.c | | | 28 | ++++++++++++++++++++- - - - - - - - |
| M | lib/bluetooth/hci_lib.h | | | 2 | +- |
2 files changed, 21 insertions(+), 9 deletions(-)