[PATCH] net/nfc/nci: use memset avoid infoleaks
From: cgel . zte
Date: Tue Mar 01 2022 - 03:18:06 EST
From: Minghao Chi (CGEL ZTE) <chi.minghao@xxxxxxxxxx>
Use memset to initialize structs to preventing infoleaks
in nci_set_config
Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@xxxxxxxxxx>
---
net/nfc/nci/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index d2537383a3e8..32be42be1152 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -641,6 +641,7 @@ int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, const __u8 *val)
if (!val || !len)
return 0;
+ memset(¶m, 0x0, sizeof(param));
param.id = id;
param.len = len;
param.val = val;
--
2.25.1