diff options
author | Tedd Ho-Jeong An <tedd.an@intel.com> | 2021-11-12 18:35:57 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-11-15 13:07:07 -0800 |
commit | 1722bf1258cbc82256045d576c9e26e49ea3b3d9 (patch) | |
tree | 5bb938cc56aef46cecf1c0c3a95a255748aea384 /emulator | |
parent | 927059ba6097147cee62a56d43c75437e26614b7 (diff) | |
download | bluez-1722bf1258cbc82256045d576c9e26e49ea3b3d9.tar.gz |
emulator: Fix uninitiailzed scalar variable
This patch fixes the uninitiailzed varialble(CWE-457) reported by
the Coverity scan.
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/bthost.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/emulator/bthost.c b/emulator/bthost.c index 61f1cd361..66e337f34 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -1570,6 +1570,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); @@ -2123,6 +2124,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); @@ -2136,6 +2138,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); |