From c42702cfc48e74d0d19a3d2f08049d2b5d0c85f4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 24 Apr 2024 14:51:50 -0400 Subject: [PATCH] bap: Fix use of unintialized variable This fixes the following trace found with valgrind: Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s) at 0x5318B0E: setsockopt (in /usr/lib64/libc.so.6) by 0x39C454: iso_set_qos (btio.c:899) by 0x39C622: bt_io_set (btio.c:1900) by 0x37F3B3: iso_do_big_sync (bap.c:2874) by 0x3991EC: server_cb (btio.c:265) by 0x3991EC: server_cb (btio.c:242) by 0x496C4FB: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.7600.6) by 0x49CA6B7: ??? (in /usr/lib64/libglib-2.0.so.0.7600.6) by 0x496BAFE: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.7600.6) by 0x4F9694: mainloop_run (mainloop-glib.c:66) by 0x4F9B27: mainloop_run_with_signal (mainloop-notify.c:188) by 0x2BE8F2: main (main.c:1464) Address 0x1fff0004c1 is on thread 1's stack in frame #2, created by bt_io_set (btio.c:1870) --- profiles/audio/bap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 485256ec9..8e4f4b311 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -2853,6 +2853,7 @@ static void iso_do_big_sync(GIOChannel *io, void *user_data) iso_bc_addr.bc_num_bis = 1; /* Set the user requested QOS */ + memset(&qos, 0, sizeof(qos)); qos.bcast.big = setup->qos.bcast.big; qos.bcast.bis = setup->qos.bcast.bis; qos.bcast.sync_factor = setup->qos.bcast.sync_factor; -- 2.47.3