Message ID | 9b7b8130a4296de7e02435d7be3c6d00c4976427.1715423446.git.pav@iki.fi |
---|---|
State | New |
Headers | show |
Series | [BlueZ] tools: fix using too small buffers in test-runner | expand |
Hello: This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Sat, 11 May 2024 13:32:07 +0300 you wrote: > Fix compiler warning: > > tools/test-runner.c:309:57: error: 'sprintf' may write a terminating nul > past the end of the destination [-Werror=format-overflow=] > --- > tools/test-runner.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Here is the summary with links: - [BlueZ] tools: fix using too small buffers in test-runner https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=24039249854e You are awesome, thank you!
diff --git a/tools/test-runner.c b/tools/test-runner.c index 243eab468..5bdcf42fc 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -302,10 +302,10 @@ static void start_qemu(void) const char *path = "/tmp/bt-server-bredr"; char *chrdev, *serdev; - chrdev = alloca(32 + strlen(path)); + chrdev = alloca(48 + strlen(path)); sprintf(chrdev, "socket,path=%s,id=bt%d", path, i); - serdev = alloca(32); + serdev = alloca(48); sprintf(serdev, "pci-serial,chardev=bt%d", i); argv[pos++] = "-chardev";