@@ -35,38 +35,38 @@ static void sw_append_stream(struct img_type *img, const char *key,
char seek_str[MAX_SEEK_STRING_SIZE];
if (!strcmp(key, "type"))
- strncpy(img->type, value,
+ strlcpy(img->type, value,
sizeof(img->type));
if (!strcmp(key, "filename")) {
- strncpy(img->fname, value,
+ strlcpy(img->fname, value,
sizeof(img->fname));
img->required = 1;
}
if (!strcmp(key, "name")) {
- strncpy(img->id.name, value,
+ strlcpy(img->id.name, value,
sizeof(img->id.name));
}
if (!strcmp(key, "version")) {
- strncpy(img->id.version, value,
+ strlcpy(img->id.version, value,
sizeof(img->id.version));
}
if (!strcmp(key, "mtdname") || !strcmp(key, "dest"))
- strncpy(img->path, value,
+ strlcpy(img->path, value,
sizeof(img->path));
if (!strcmp(key, "filesystem"))
- strncpy(img->filesystem, value,
+ strlcpy(img->filesystem, value,
sizeof(img->filesystem));
if (!strcmp(key, "volume"))
- strncpy(img->volname, value,
+ strlcpy(img->volname, value,
sizeof(img->volname));
if (!strcmp(key, "device_id"))
- strncpy(img->device, value,
+ strlcpy(img->device, value,
sizeof(img->device));
if (!strcmp(key, "device"))
- strncpy(img->device, value,
+ strlcpy(img->device, value,
sizeof(img->device));
if (!strncmp(key, offset, sizeof(offset))) {
- strncpy(seek_str, value,
+ strlcpy(seek_str, value,
sizeof(seek_str));
/* convert the offset handling multiplicative suffixes */
img->seek = ustrtoull(seek_str, 0);
@@ -77,7 +77,7 @@ static void sw_append_stream(struct img_type *img, const char *key,
if (!strcmp(key, "script"))
img->is_script = 1;
if (!strcmp(key, "path"))
- strncpy(img->path, value,
+ strlcpy(img->path, value,
sizeof(img->path));
if (!strcmp(key, "sha256"))
ascii_to_hash(img->sha256, value);
Signed-off-by: Stefano Babic <sbabic@denx.de> --- parser/parse_external.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)