The branch main has been updated by jhb:

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

commit faae895fec6571242ae05b11bc7eba0dff83fa49
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2025-04-11 19:12:58 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2025-04-11 19:12:58 +0000

    fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning
    
    tests/sys/fs/fusefs/xattr.cc:572:50: error: size argument in 'strlcpy' call 
appears to be size of the source; expected the size of the destination 
[-Werror,-Wstrlcpy-strlcat-size]
      572 |                         strlcpy((char*)out.body.bytes, attrs1, 
sizeof(attrs1));
          |                                                                
~~~~~~~^~~~~~~
    
    The warning is correct in that the size is the size of the source, but
    that is intended in this case.  Use memcpy() instead of strlcpy() to
    match the same code in the size_only_race_smaller test above.
    
    Differential Revision:  https://reviews.freebsd.org/D49786
---
 tests/sys/fs/fusefs/xattr.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sys/fs/fusefs/xattr.cc b/tests/sys/fs/fusefs/xattr.cc
index b1cbb9ffa768..0cd2783551b4 100644
--- a/tests/sys/fs/fusefs/xattr.cc
+++ b/tests/sys/fs/fusefs/xattr.cc
@@ -569,7 +569,7 @@ TEST_F(Listxattr, size_only_race_smaller)
        }));
        expect_listxattr(ino, sizeof(attrs0),
                ReturnImmediate([&](auto in __unused, auto& out) {
-                       strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
+                       memcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
                        out.header.len = sizeof(fuse_out_header) +
                            sizeof(attrs1);
                })

Reply via email to