From 92af0c97520f0b5f3603bf64b1c4928c2f86aa1c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 13 Nov 2020 21:46:05 +0100 Subject: [PATCH] Adjusted fix 7e3b01b after learning that the bug stems from b0230b6 (unreleased) --- libisofs/system_area.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libisofs/system_area.c b/libisofs/system_area.c index d5a1c13..bba9d4f 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -1043,12 +1043,12 @@ 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; - memset((char *) entry->name, 0, 32); for (l = 0; l < 32 && name[l] != 0; l++); - memcpy((char *) entry->name, name, l); - memset((char *) entry->type, 0, 32); + if (l > 0) + memcpy((char *) entry->name, name, l); for (l = 0; l < 32 && type[l] != 0; l++); - memcpy((char *) entry->type, type, l); + if (l > 0) + memcpy((char *) entry->type, type, l); entry->req_status = 0; ret = iso_register_apm_entry(req_array, apm_req_count, entry, 0); free(entry);