* [PATCH] lockdown: Initialize array before use
@ 2024-12-28 7:45 Tanya Agarwal
0 siblings, 0 replies; only message in thread
From: Tanya Agarwal @ 2024-12-28 7:45 UTC (permalink / raw)
To: paul, jmorris, serge
Cc: kees, yuehaibing, linux-security-module, linux-kernel, skhan,
anupnewsmail, tanyaagarwal25699
From: Tanya Agarwal <tanyaagarwal25699@gmail.com>
Intialize array before use in lockdown.c.
CID 1486102: (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value *temp when calling
strlen.
Coverity Link:
https://scan7.scan.coverity.com/#/project-view/52849/11354?selectedIssue=1486102
Signed-off-by: Tanya Agarwal <tanyaagarwal25699@gmail.com>
---
security/lockdown/lockdown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index f2bdbd55aa2b..df2c8435a7a9 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -96,7 +96,7 @@ static int __init lockdown_lsm_init(void)
static ssize_t lockdown_read(struct file *filp, char __user *buf, size_t count,
loff_t *ppos)
{
- char temp[80];
+ char temp[80] = {0};
int i, offset = 0;
for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) {
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-28 7:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-28 7:45 [PATCH] lockdown: Initialize array before use Tanya Agarwal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®