strcpy => strlcpy

Reported by:	Coverity
CID:		1352771
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
This commit is contained in:
asomers 2017-05-10 15:27:36 +00:00
parent 4de1acd72b
commit b2359e58e4

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;