* [BlueZ] hci-tester: Work-around possible string overflow
@ 2026-06-16 8:55 Bastien Nocera
2026-06-16 13:05 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Bastien Nocera @ 2026-06-16 8:55 UTC (permalink / raw)
To: linux-bluetooth
Quiet overflow warning by checking for a non-NULL destination.
In function 'memcpy',
inlined from 'test_pre_setup_lt_address' at tools/hci-tester.c:67:2:
/usr/include/bits/string_fortified.h:29:10: warning: '__builtin_memcpy' writing 6 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ^
---
tools/hci-tester.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/hci-tester.c b/tools/hci-tester.c
index b8446ee83ccf..c9e7c58d2e95 100644
--- a/tools/hci-tester.c
+++ b/tools/hci-tester.c
@@ -12,6 +12,7 @@
#include <config.h>
#endif
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -57,6 +58,7 @@ static void test_pre_setup_lt_address(const void *data, uint8_t size,
struct user_data *user = tester_get_data();
const struct bt_hci_rsp_read_bd_addr *rsp = data;
+ assert(user);
if (rsp->status) {
tester_warn("Read lower tester address failed (0x%02x)",
rsp->status);
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-16 13:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 8:55 [BlueZ] hci-tester: Work-around possible string overflow Bastien Nocera
2026-06-16 13:05 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox