mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-05 06:11:44 +00:00
common: nvedit: use snprintf instead of sprintf
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 <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
5a6894397a
commit
5d49b4cdf9
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
sprintf(buffer, "%s", init_val);
|
||||
snprintf(buffer, CONFIG_SYS_CBSIZE, "%s", init_val);
|
||||
else
|
||||
buffer[0] = '\0';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue