From 04ebe29188032c9d2b0fd80b2571a82aa3013134 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Thu, 8 Jul 2021 12:13:40 +0900 Subject: [PATCH] dprintf_dnode: strcpy -> strlcpy Missed a couple of strcpy() in earlier commit, this is only used with --enable-debug. Reviewed-by: Brian Behlendorf Reviewed-by: Tony Nguyen Signed-off-by: Jorgen Lundman Closes #12311 --- include/sys/dbuf.h | 2 +- include/sys/dnode.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h index 6ae079c6a6..d2c175af64 100644 --- a/include/sys/dbuf.h +++ b/include/sys/dbuf.h @@ -465,7 +465,7 @@ dbuf_find_dirty_eq(dmu_buf_impl_t *db, uint64_t txg) char __db_buf[32]; \ uint64_t __db_obj = (dbuf)->db.db_object; \ if (__db_obj == DMU_META_DNODE_OBJECT) \ - (void) strcpy(__db_buf, "mdn"); \ + (void) strlcpy(__db_buf, "mdn", sizeof (__db_buf)); \ else \ (void) snprintf(__db_buf, sizeof (__db_buf), "%lld", \ (u_longlong_t)__db_obj); \ diff --git a/include/sys/dnode.h b/include/sys/dnode.h index de6492bb76..2cdc5b8798 100644 --- a/include/sys/dnode.h +++ b/include/sys/dnode.h @@ -600,7 +600,7 @@ extern dnode_stats_t dnode_stats; char __db_buf[32]; \ uint64_t __db_obj = (dn)->dn_object; \ if (__db_obj == DMU_META_DNODE_OBJECT) \ - (void) strcpy(__db_buf, "mdn"); \ + (void) strlcpy(__db_buf, "mdn", sizeof (__db_buf)); \ else \ (void) snprintf(__db_buf, sizeof (__db_buf), "%lld", \ (u_longlong_t)__db_obj);\