[Bug 292528] strlcpy truncates result

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 17 Jan 2026 05:32:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292528

Simon Wollwage <rootnode+freebsd@wollwage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rootnode+freebsd@wollwage.c
                   |                            |om

--- Comment #2 from Simon Wollwage <rootnode+freebsd@wollwage.com> ---
I think because in that example, src and dst are both pointing to the same
list, you might run into undefined behavior there. 

The implementation of strlcpy is the same on 13.1 and 14.3
(https://github.com/freebsd/freebsd-src/blob/releng/13.1/lib/libc/string/strlcpy.c
and
https://github.com/freebsd/freebsd-src/blob/releng/14.3/lib/libc/string/strlcpy.c)

My best guess is that the different LLVM versions might optimize the copying
differently, resulting in the UB.

-- 
You are receiving this mail because:
You are the assignee for the bug.