Skip to content

Commit 0cc9f8e

Browse files
abonislawskilgirdwood
authored andcommitted
rimage: ensure null termination
Ensure null termination in man_module_create_reloc Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent b03f0e4 commit 0cc9f8e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/rimage/src/manifest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
512512
unsigned int j;
513513

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

516518
for (j = 0; j < image->adsp->modules->mod_man_count; j++) {
517519
if (!strncmp(name, (char *)image->adsp->modules->mod_man[j].name,

0 commit comments

Comments
 (0)