rimage: fix possible buffer overflow

Fixes possible buffer overflow with strcpy.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2018-11-28 12:35:57 +01:00
parent 31cde1ce97
commit 4bd543c337
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image,
if (!image->key_name)
sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX);
else
strcpy(path, image->key_name);
strncpy(path, image->key_name, 256);
fprintf(stdout, " pkcs: signing with key %s\n", path);
fp = fopen(path, "r");