Skip to content

Commit

Permalink
rimage: ensure null termination
Browse files Browse the repository at this point in the history
Ensure null termination in man_module_create_reloc

Signed-off-by: Adrian Bonislawski <[email protected]>
  • Loading branch information
abonislawski committed Dec 19, 2024
1 parent f4cd55c commit e1b14fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/rimage/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *

for (i = 0, sof_mod = section.data; i < n_mod; i++, sof_mod++) {
char name[SOF_MAN_MOD_NAME_LEN + 1];
/* Ensure null termination */
name[SOF_MAN_MOD_NAME_LEN] = '\0';
unsigned int j;

strncpy(name, (char *)sof_mod->module.name, SOF_MAN_MOD_NAME_LEN);
Expand Down

0 comments on commit e1b14fd

Please sign in to comment.