]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tunefs: clear the entire previous label when setting a new one
authoremaste <emaste@FreeBSD.org>
Mon, 7 Mar 2016 19:14:26 +0000 (19:14 +0000)
committeremaste <emaste@FreeBSD.org>
Mon, 7 Mar 2016 19:14:26 +0000 (19:14 +0000)
commitb312d89ffd87ca6261238586e1ad8eba74c87256
treedb1ad4bf5fda67e18d02cd40bebc6c0bc3899587
parent1e048a7127a7ef3ebaa416e31aaa32769732a0b6
tunefs: clear the entire previous label when setting a new one

strlcpy(3) null terminates but does not zero-fill the buffer, so would
leave beind any portion of the previous volume label longer than the
new one.

Note that tunefs only allows -L args up to a length of MAXVOLLEN-1, so
the stored label will be null-terminated (whether or not required by
UFS).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
sbin/tunefs/tunefs.c