Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] emulator: Avoid variable length array in send_cmd
@ 2026-10-18  4:39 Iaroslav Voitovych
  2026-10-18  7:22 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Iaroslav Voitovych @ 2026-10-18  4:39 UTC (permalink / raw)
  To: linux-bluetooth

Use newa() for the iovec array of send_cmd(), as shared/gatt-client
does, instead of a variable length array.

This fixes the following warning:

emulator/btdev.c:479:29: warning: Variable length array is used.
---
 emulator/btdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 67eac8fd0..7a8d8a464 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -476,7 +476,7 @@ static void send_cmd(struct btdev *btdev, uint8_t evt, uint16_t opcode,
 					const struct iovec *iov, int iovlen)
 {
 	struct bt_hci_evt_hdr hdr;
-	struct iovec iov2[2 + iovlen];
+	struct iovec *iov2 = newa(struct iovec, 2 + iovlen);
 	uint8_t pkt = BT_H4_EVT_PKT;
 	int i;
 

base-commit: fa6ba55020dee3c3183041c854c347b4582448be
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-18  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18  4:39 [PATCH BlueZ] emulator: Avoid variable length array in send_cmd Iaroslav Voitovych
2026-10-18  7:22 ` [BlueZ] " 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