mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bcachefs: replace deprecated strncpy() with strscpy()
@ 2025-03-26  9:44 Roxana Nicolescu
  2025-03-26 10:02 ` Alan Huang
  0 siblings, 1 reply; 10+ messages in thread
From: Roxana Nicolescu @ 2025-03-26  9:44 UTC (permalink / raw)
  To: kent.overstreet, linux-bcachefs, linux-kernel; +Cc: skhan, linux-kernel-mentees

strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy() instead.

Link: https://github.com/KSPP/linux/issues/90
Signed-off-by: Roxana Nicolescu <nicolescu.roxana@protonmail.com>
---
 fs/bcachefs/btree_trans_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
index c4f524b2ca9a..7ab25b425d11 100644
--- a/fs/bcachefs/btree_trans_commit.c
+++ b/fs/bcachefs/btree_trans_commit.c
@@ -364,7 +364,7 @@ static noinline void journal_transaction_name(struct btree_trans *trans)
 	struct jset_entry_log *l =
 		container_of(entry, struct jset_entry_log, entry);
 
-	strncpy(l->d, trans->fn, JSET_ENTRY_LOG_U64s * sizeof(u64));
+	strscpy(l->d, trans->fn, JSET_ENTRY_LOG_U64s * sizeof(u64));
 }
 
 static inline int btree_key_can_insert(struct btree_trans *trans,
-- 
2.34.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-26 17:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-26  9:44 [PATCH] bcachefs: replace deprecated strncpy() with strscpy() Roxana Nicolescu
2025-03-26 10:02 ` Alan Huang
2025-03-26 12:19   ` Kent Overstreet
2025-03-26 14:40     ` Roxana Nicolescu
2025-03-26 14:47       ` Kent Overstreet
2025-03-26 15:49         ` Bharadwaj Raju
2025-03-26 16:17           ` Kent Overstreet
2025-03-26 16:36             ` Alan Huang
2025-03-26 16:41               ` Kent Overstreet
2025-03-26 17:05                 ` Roxana Nicolescu

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®