git: 0bd5fb421a1e - stable/14 - mksnap_ffs: fix running unded chroot
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Nov 2025 07:15:48 UTC
The branch stable/14 has been updated by sobomax:
URL: https://cgit.FreeBSD.org/src/commit/?id=0bd5fb421a1e85e75deb461660d8cfe6d139f1c4
commit 0bd5fb421a1e85e75deb461660d8cfe6d139f1c4
Author: Maxim Sobolev <sobomax@FreeBSD.org>
AuthorDate: 2025-09-23 16:24:44 +0000
Commit: Maxim Sobolev <sobomax@FreeBSD.org>
CommitDate: 2025-11-05 07:14:04 +0000
mksnap_ffs: fix running unded chroot
Fix "run-under-chroot" workaround by replacing strlcpy(2) with
memmove(2) since strings overlap.
Reviewed by: arrowd
Differential Revision: https://reviews.freebsd.org/D52670
(cherry picked from commit 60be0d71daab4247dc61c323777b0c593eb76975)
---
sbin/mksnap_ffs/mksnap_ffs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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