From b0230b6ac8fb618dce02e7f20bb3ffd4f2a6a45e Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 7 Jul 2020 12:23:20 +0200 Subject: [PATCH] Changed strncpy() to memcpy() in order to please static analyzers --- libisofs/system_area.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libisofs/system_area.c b/libisofs/system_area.c index 2351851..5d143ec 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -794,7 +794,7 @@ static int make_sun_disk_label(Ecma119Image *t, uint8_t *buf, int flag) /* 0 - 127 | label | ASCII Label */ if (t->opts->ascii_disc_label[0]) - strncpy((char *) buf, t->opts->ascii_disc_label, 128); + memcpy((char *) buf, t->opts->ascii_disc_label, 128); else strcpy((char *) buf, "CD-ROM Disc with Sun sparc boot created by libisofs"); @@ -1040,8 +1040,8 @@ int iso_quick_apm_entry(struct iso_apm_partition_request **req_array, return ISO_OUT_OF_MEM; entry->start_block = start_block; entry->block_count = block_count; - strncpy((char *) entry->name, name, 32); - strncpy((char *) entry->type, type, 32); + memcpy((char *) entry->name, name, 32); + memcpy((char *) entry->type, type, 32); entry->req_status = 0; ret = iso_register_apm_entry(req_array, apm_req_count, entry, 0); free(entry);