Skip to content

Commit 04ebe29

Browse files
lundmantonyhutter
authored andcommitted
dprintf_dnode: strcpy -> strlcpy
Missed a couple of strcpy() in earlier commit, this is only used with --enable-debug. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12311
1 parent a0b4da2 commit 04ebe29

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/sys/dbuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ dbuf_find_dirty_eq(dmu_buf_impl_t *db, uint64_t txg)
465465
char __db_buf[32]; \
466466
uint64_t __db_obj = (dbuf)->db.db_object; \
467467
if (__db_obj == DMU_META_DNODE_OBJECT) \
468-
(void) strcpy(__db_buf, "mdn"); \
468+
(void) strlcpy(__db_buf, "mdn", sizeof (__db_buf)); \
469469
else \
470470
(void) snprintf(__db_buf, sizeof (__db_buf), "%lld", \
471471
(u_longlong_t)__db_obj); \

include/sys/dnode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ extern dnode_stats_t dnode_stats;
600600
char __db_buf[32]; \
601601
uint64_t __db_obj = (dn)->dn_object; \
602602
if (__db_obj == DMU_META_DNODE_OBJECT) \
603-
(void) strcpy(__db_buf, "mdn"); \
603+
(void) strlcpy(__db_buf, "mdn", sizeof (__db_buf)); \
604604
else \
605605
(void) snprintf(__db_buf, sizeof (__db_buf), "%lld", \
606606
(u_longlong_t)__db_obj);\

0 commit comments

Comments
 (0)