mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] orangefs_inode_getxattr(): replace deprecated strcpy with strscpy
@ 2024-11-06  2:07 Daniel Yang
  0 siblings, 0 replies; only message in thread
From: Daniel Yang @ 2024-11-06  2:07 UTC (permalink / raw)
  To: Mike Marshall, Martin Brandenburg, open list:ORANGEFS FILESYSTEM,
	open list
  Cc: Daniel Yang

The strcpy() function does not do bounds checking. strscpy() is the
recommended replacement to the deprecated function. The return value of
strcpy is not used so there shouldn't be issues here.

Signed-off-by: Daniel Yang <danielyangkang@gmail.com>
---
 fs/orangefs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c
index 74ef75586..d27ff38cf 100644
--- a/fs/orangefs/xattr.c
+++ b/fs/orangefs/xattr.c
@@ -150,7 +150,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name,
 		goto out_unlock;
 
 	new_op->upcall.req.getxattr.refn = orangefs_inode->refn;
-	strcpy(new_op->upcall.req.getxattr.key, name);
+	strscpy(new_op->upcall.req.getxattr.key, name);
 
 	/*
 	 * NOTE: Although keys are meant to be NULL terminated textual
-- 
2.39.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-06  2:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-06  2:07 [PATCH] orangefs_inode_getxattr(): replace deprecated strcpy with strscpy Daniel Yang

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®