projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a68943
)
common: nvedit: use snprintf instead of sprintf
author
Peng Fan
<
[email protected]
>
Wed, 23 Dec 2015 04:08:09 +0000
(12:08 +0800)
committer
Tom Rini
<
[email protected]
>
Mon, 4 Jan 2016 17:25:36 +0000
(12:25 -0500)
Use snprintf to replace sprintf.
Coverity log:
"
Unbounded source buffer (STRING_SIZE)
string_size: Passing string init_val of unknown size to sprintf.
"
Reported-by: Coverity
Signed-off-by: Peng Fan <
[email protected]
>
Cc: Tom Rini <
[email protected]
>
Cc: Simon Glass <
[email protected]
>
Reviewed-by: Joe Hershberger <
[email protected]
>
common/cmd_nvedit.c
patch
|
blob
|
history
diff --git
a/common/cmd_nvedit.c
b/common/cmd_nvedit.c
index 2f9cdd095a7b7bbaf4d47e5435eed7e3931a9bf5..5ae9d9d5ae36b94335c3acffac86bafecf3e4a35 100644
(file)
--- a/
common/cmd_nvedit.c
+++ b/
common/cmd_nvedit.c
@@
-595,7
+595,7
@@
static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
/* Set read buffer to initial value or empty sting */
init_val = getenv(argv[1]);
if (init_val)
- s
printf(buffer
, "%s", init_val);
+ s
nprintf(buffer, CONFIG_SYS_CBSIZE
, "%s", init_val);
else
buffer[0] = '\0';