strcpy => strlcpy

Reported by:	Coverity
CID:		1352771
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
This commit is contained in:
Alan Somers 2017-05-10 15:27:36 +00:00
parent 50bc66f437
commit 5cbe126a6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318141

View file

@ -192,7 +192,8 @@ int main(int argc, char **argv)
/* Not reached */
}
strcpy(hdr.magic, cfs.handler->magic);
assert(strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic))
< sizeof(hdr.magic));
if (cfs.en_dedup != 0) {
hdr.magic[CLOOP_OFS_VERSN] = CLOOP_MAJVER_3;