diff options
author | Masami Hiramatsu | 2022-01-31 11:52:20 +0900 |
---|---|---|
committer | Tom Rini | 2022-02-11 11:29:23 -0500 |
commit | d8ae90a8d47da2f22041bf9f6fd6d42a598f44ee (patch) | |
tree | 1ac6a6f17975e6cdb5653a1adffdfa6c3a1cb8c4 | |
parent | 32a711dbdbec9aed6777d1059d115b1c83d36fca (diff) |
DFU: Do not copy the entity name over the buffer size
Use strlcpy() instead of strcpy() to prevent copying the
entity name over the name buffer size.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
-rw-r--r-- | drivers/dfu/dfu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index af3975925a9..66c41b5e762 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -503,7 +503,7 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, int alt, debug("%s: %s interface: %s dev: %s\n", __func__, s, interface, devstr); st = strsep(&s, " "); - strcpy(dfu->name, st); + strlcpy(dfu->name, st, DFU_NAME_SIZE); dfu->alt = alt; dfu->max_buf_size = 0; |