[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251021143952.37036-1-biancaa2210329@ssn.edu.in>
Date: Tue, 21 Oct 2025 20:09:52 +0530
From: Biancaa Ramesh <biancaa2210329@....edu.in>
To: linux-kernel@...r.kernel.org
Cc: Biancaa Ramesh <biancaa2210329@....edu.in>
Subject: [PATCH] replace strcpy with strscpy for safe copy
Signed-off-by: Biancaa Ramesh <biancaa2210329@....edu.in>
---
fs/ufs/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 0388a1bae326..cffb7863adc5 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -557,14 +557,14 @@ int ufs_make_empty(struct inode * inode, struct inode *dir)
ufs_set_de_type(sb, de, inode->i_mode);
ufs_set_de_namlen(sb, de, 1);
de->d_reclen = cpu_to_fs16(sb, UFS_DIR_REC_LEN(1));
- strcpy (de->d_name, ".");
+ strscpy(de->d_name, ".", sizeof(de->d_name));
de = (struct ufs_dir_entry *)
((char *)de + fs16_to_cpu(sb, de->d_reclen));
de->d_ino = cpu_to_fs32(sb, dir->i_ino);
ufs_set_de_type(sb, de, dir->i_mode);
de->d_reclen = cpu_to_fs16(sb, chunk_size - UFS_DIR_REC_LEN(1));
ufs_set_de_namlen(sb, de, 2);
- strcpy (de->d_name, "..");
+ strscpy(de->d_name, "..", sizeof(de->d_name));
kunmap_local(kaddr);
ufs_commit_chunk(folio, 0, chunk_size);
--
2.43.0
--
::DISCLAIMER::
---------------------------------------------------------------------
The
contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only. Views or opinions, if any,
presented in
this email are solely those of the author and may not
necessarily reflect
the views or opinions of SSN Institutions (SSN) or its
affiliates. Any form
of reproduction, dissemination, copying, disclosure,
modification,
distribution and / or publication of this message without the
prior written
consent of authorized representative of SSN is strictly
prohibited. If you
have received this email in error please delete it and
notify the sender
immediately.
---------------------------------------------------------------------
Header of this mail should have a valid DKIM signature for the domain
ssn.edu.in <http://www.ssn.edu.in/>
Powered by blists - more mailing lists