projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b52c6ff
)
emulator: Fix uninitiailzed scalar variable
author
Tedd Ho-Jeong An
<tedd.an@intel.com>
Sat, 13 Nov 2021 02:35:57 +0000
(18:35 -0800)
committer
Ayush Garg
<ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:38 +0000
(19:08 +0530)
This patch fixes the uninitiailzed varialble(CWE-457) reported by
the Coverity scan.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/bthost.c
patch
|
blob
|
history
diff --git
a/emulator/bthost.c
b/emulator/bthost.c
index 914c7a9d1683d0f4e3c5c52aa54e9c9af91cf4b0..db4d14359f647ba024681251c051a3f6d70d8ae2 100755
(executable)
--- 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);