Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/rimage/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *

if (!n_mod || n_mod * sizeof(*sof_mod) != section.header.data.size) {
fprintf(stderr, "error: Invalid module manifests in '.module' section.\n");
elf_section_free(&section);
return -ENOEXEC;
}

Expand All @@ -512,6 +513,8 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
unsigned int j;

strncpy(name, (char *)sof_mod->module.name, SOF_MAN_MOD_NAME_LEN);
/* Ensure null termination */
name[SOF_MAN_MOD_NAME_LEN] = '\0';

for (j = 0; j < image->adsp->modules->mod_man_count; j++) {
if (!strncmp(name, (char *)image->adsp->modules->mod_man[j].name,
Expand All @@ -530,6 +533,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *

if (j == image->adsp->modules->mod_man_count) {
fprintf(stderr, "error: cannot find %s in manifest.\n", name);
elf_section_free(&section);
return -ENOEXEC;
}
}
Expand Down
Loading