From 5cbe126a6d5ae0019a518bea2f60c61f0ff546f8 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Wed, 10 May 2017 15:27:36 +0000 Subject: [PATCH] strcpy => strlcpy Reported by: Coverity CID: 1352771 MFC after: 3 weeks Sponsored by: Spectra Logic Corp --- usr.bin/mkuzip/mkuzip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/mkuzip/mkuzip.c b/usr.bin/mkuzip/mkuzip.c index 6288f4e2d1d0..e046c735a036 100644 --- a/usr.bin/mkuzip/mkuzip.c +++ b/usr.bin/mkuzip/mkuzip.c @@ -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;