Adjusted fix 7e3b01b after learning that the bug stems from b0230b6 (unreleased)

This commit is contained in:
Thomas Schmitt 2020-11-13 21:46:05 +01:00
parent daaee5e7e6
commit 92af0c9752

View File

@ -1043,12 +1043,12 @@ int iso_quick_apm_entry(struct iso_apm_partition_request **req_array,
return ISO_OUT_OF_MEM; return ISO_OUT_OF_MEM;
entry->start_block = start_block; entry->start_block = start_block;
entry->block_count = block_count; entry->block_count = block_count;
memset((char *) entry->name, 0, 32);
for (l = 0; l < 32 && name[l] != 0; l++); for (l = 0; l < 32 && name[l] != 0; l++);
memcpy((char *) entry->name, name, l); if (l > 0)
memset((char *) entry->type, 0, 32); memcpy((char *) entry->name, name, l);
for (l = 0; l < 32 && type[l] != 0; 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; entry->req_status = 0;
ret = iso_register_apm_entry(req_array, apm_req_count, entry, 0); ret = iso_register_apm_entry(req_array, apm_req_count, entry, 0);
free(entry); free(entry);