smb: minor fix to use sizeof to initialize flags_string buffer
authorBharath SM <bharathsm@microsoft.com>
Thu, 19 Jun 2025 15:35:33 +0000 (21:05 +0530)
committerSteve French <stfrench@microsoft.com>
Sat, 21 Jun 2025 16:03:25 +0000 (11:03 -0500)
Replaced hardcoded length with sizeof(flags_string).

Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifs_debug.c

index c0196be0e65fc0c6a3b965d70068bf87ddd036fe..3fdf75737d43cc84db5a9f349dc323229c9778eb 100644 (file)
@@ -1105,7 +1105,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
        if ((count < 1) || (count > 11))
                return -EINVAL;
 
-       memset(flags_string, 0, 12);
+       memset(flags_string, 0, sizeof(flags_string));
 
        if (copy_from_user(flags_string, buffer, count))
                return -EFAULT;