Skip to content

Commit

Permalink
lockdown: initialize local array before use to quiet static analysis
Browse files Browse the repository at this point in the history
The static code analysis tool "Coverity Scan" pointed the following
details out for further development considerations:

  CID 1486102: Uninitialized scalar variable (UNINIT)
  uninit_use_in_call: Using uninitialized value *temp when calling
                      strlen.

Signed-off-by: Tanya Agarwal <[email protected]>
[PM: edit/reformat the description, subject line]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
TanyaAgarwal25 authored and pcmoore committed Jan 5, 2025
1 parent f09ff30 commit 714d87c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/lockdown/lockdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = "";
int i, offset = 0;

for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) {
Expand Down

0 comments on commit 714d87c

Please sign in to comment.