From: Tanya Agarwal Date: Sun, 5 Jan 2025 07:05:38 +0000 (+0530) Subject: lockdown: initialize local array before use to quiet static analysis X-Git-Tag: v6.14-rc1~166^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=714d87c90a766e6917f7d69f618b864d350f09d3;p=thirdparty%2Flinux.git lockdown: initialize local array before use to quiet static analysis 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 [PM: edit/reformat the description, subject line] Signed-off-by: Paul Moore --- diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c index f2bdbd55aa2bc..cf83afa1d879a 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] = ""; int i, offset = 0; for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) {