mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 11:55:03 +00:00
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>
This commit is contained in:
parent
32a711dbdb
commit
d8ae90a8d4
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
debug("%s: %s interface: %s dev: %s\n", __func__, s, interface, devstr);
|
||||||
st = strsep(&s, " ");
|
st = strsep(&s, " ");
|
||||||
strcpy(dfu->name, st);
|
strlcpy(dfu->name, st, DFU_NAME_SIZE);
|
||||||
|
|
||||||
dfu->alt = alt;
|
dfu->alt = alt;
|
||||||
dfu->max_buf_size = 0;
|
dfu->max_buf_size = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue