git: eebccaae3672 - stable/11 - ffs: avoid creating corrupt extattrfile

Ed Maste emaste at FreeBSD.org
Mon Jan 18 18:53:44 UTC 2021


The branch stable/11 has been updated by emaste:

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

commit eebccaae36722f62bc8f05e6c71b867d69faca5f
Author:     Ed Maste <emaste at FreeBSD.org>
AuthorDate: 2021-01-18 16:58:38 +0000
Commit:     Ed Maste <emaste at FreeBSD.org>
CommitDate: 2021-01-18 18:49:56 +0000

    ffs: avoid creating corrupt extattrfile
    
    This is part of r312416 / e6790841f749, suggested by ml at netfence.it,
    and at least means we will stop creating corrupt extattr that is not
    handled by some later versions.
    
    PR:             244089
---
 sys/ufs/ffs/ffs_vnops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index d2779489180f..9ffaf19a86d7 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1668,7 +1668,7 @@ vop_setextattr {
 	*p++ = ap->a_attrnamespace;
 	*p++ = eapad2;
 	*p++ = strlen(ap->a_name);
-	strcpy(p, ap->a_name);
+	memcpy(p, ap->a_name, strlen(ap->a_name));
 	p += strlen(ap->a_name);
 	bzero(p, eapad1);
 	p += eapad1;


More information about the dev-commits-src-branches mailing list