6584e5a mount(8): Avoid truncation when fstab-formatting unionfs mount info

Authored and Committed by Jason A. Harmening 7 months ago
    mount(8): Avoid truncation when fstab-formatting unionfs mount info
    
    When displaying unionfs mounts in fstab format (`mount -p`), mount(8)
    currently uses strlcpy to remove the disposition prefix from the mount
    name returned by getmntinfo(3).  But strlcpy, like strcpy before it,
    does not guarantee correct behavior if the source and destination
    buffers overlap.
    
    Just offset the buffer and avoid the destructive copy in the first
    place.
    
    PR:		283420
    Reviewed by:	imp (previous version), olce
    Differential Revision: https://reviews.freebsd.org/D48177
    
    (cherry picked from commit a314c60625af1829b7e12c3a4cedb74d7f69d074)
    
        
file modified
+8 -8