]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use memmove to copy within a buffer
authorAndrew Turner <andrew@FreeBSD.org>
Wed, 1 Apr 2020 09:51:29 +0000 (09:51 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Wed, 1 Apr 2020 09:51:29 +0000 (09:51 +0000)
commit3a142cd10cfbc98ac30388badc697eecd4b49fc5
tree6c70df42a9149916f26e778ce4cb23e42cf3e7bf
parent89064ec6ef0fac8b2c259b6c51a300fc6fa3d53e
Use memmove to copy within a buffer

jail(8) would try to use strcpy to remove the interface from the start of
an IP address. This is undefined, and on arm64 will result in unexpected
IPv6 addresses.

Fix this by using memmove top move the string.

PR: 245102
Reported by: sbruno
MFC after: 2 weeks
Sponsored by: Innovate UK
usr.sbin/jail/config.c