aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2025-09-23 16:24:44 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2025-09-23 16:26:09 +0000
commit60be0d71daab4247dc61c323777b0c593eb76975 (patch)
treedfbfb7fb7f9a31f650926c3cc38ea8b34bd45eba
parent23e69b54973fcb68d14986ec1600d9dfd0cb7af3 (diff)
mksnap_ffs: fix running unded chroot
Fix "run-under-chroot" workaround by replacing strlcpy(2) with memmove(2) since strings overlap. MFC after: 1 week Reviewed by: arrowd Differential Revision: https://reviews.freebsd.org/D52670
-rw-r--r--sbin/mksnap_ffs/mksnap_ffs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/mksnap_ffs/mksnap_ffs.c b/sbin/mksnap_ffs/mksnap_ffs.c
index 0d8e32a15ab3..58939cc69029 100644
--- a/sbin/mksnap_ffs/mksnap_ffs.c
+++ b/sbin/mksnap_ffs/mksnap_ffs.c
@@ -150,7 +150,7 @@ main(int argc, char **argv)
errx(1, "%s: Not a mount point", stfsbuf.f_mntonname);
}
if (cp != stfsbuf.f_mntonname)
- strlcpy(stfsbuf.f_mntonname, cp, sizeof(stfsbuf.f_mntonname));
+ memmove(stfsbuf.f_mntonname, cp, strlen(cp) + 1);
/*
* Having verified access to the directory in which the