projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32a711d
)
DFU: Do not copy the entity name over the buffer size
author
Masami Hiramatsu
<masami.hiramatsu@linaro.org>
Mon, 31 Jan 2022 02:52:20 +0000
(11:52 +0900)
committer
Tom Rini
<trini@konsulko.com>
Fri, 11 Feb 2022 16:29:23 +0000
(11:29 -0500)
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>
drivers/dfu/dfu.c
patch
|
blob
|
history
diff --git
a/drivers/dfu/dfu.c
b/drivers/dfu/dfu.c
index
af39759
..
66c41b5
100644
(file)
--- 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, " ");
- str
cpy(dfu->name, st
);
+ str
lcpy(dfu->name, st, DFU_NAME_SIZE
);
dfu->alt = alt;
dfu->max_buf_size = 0;