diff options
author | Masami Hiramatsu <masami.hiramatsu@linaro.org> | 2021-12-06 14:44:38 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-28 10:21:51 -0500 |
commit | 887e38aff2a820c442788137c768a70e426e7fa2 (patch) | |
tree | bc8e67f53c1a0b877447625895eae814097fab82 | |
parent | 86b6a38863bebb70a65a53f93a1ffafc4a472169 (diff) | |
download | u-boot-887e38aff2a820c442788137c768a70e426e7fa2.zip u-boot-887e38aff2a820c442788137c768a70e426e7fa2.tar.gz u-boot-887e38aff2a820c442788137c768a70e426e7fa2.tar.bz2 |
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>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@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 af39759..66c41b5 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; |