The branch main has been updated by sobomax:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=60be0d71daab4247dc61c323777b0c593eb76975

commit 60be0d71daab4247dc61c323777b0c593eb76975
Author:     Maxim Sobolev <sobo...@freebsd.org>
AuthorDate: 2025-09-23 16:24:44 +0000
Commit:     Maxim Sobolev <sobo...@freebsd.org>
CommitDate: 2025-09-23 16:26:09 +0000

    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
---
 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

Reply via email to