From: Tedd Ho-Jeong An Date: Sat, 13 Nov 2021 02:35:57 +0000 (-0800) Subject: emulator: Fix uninitiailzed scalar variable X-Git-Tag: submit/tizen/20220313.220938~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b764b6331a1932365855b116a74e07e411768fb6;p=platform%2Fupstream%2Fbluez.git emulator: Fix uninitiailzed scalar variable This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/emulator/bthost.c b/emulator/bthost.c index 914c7a9d..db4d1435 100755 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -1569,6 +1569,7 @@ static void rfcomm_sabm_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_SABM, 1); cmd.length = RFCOMM_LEN8(0); @@ -2122,6 +2123,7 @@ static void rfcomm_ua_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_UA, 1); cmd.length = RFCOMM_LEN8(0); @@ -2135,6 +2137,7 @@ static void rfcomm_dm_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_DM, 1); cmd.length = RFCOMM_LEN8(0);