git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39ae954
)
env: mtd: initialize saved_buf pointer
author
Shiji Yang
<yangshiji66@outlook.com>
Fri, 25 Jul 2025 00:20:45 +0000
(08:20 +0800)
committer
Tom Rini
<trini@konsulko.com>
Fri, 1 Aug 2025 23:58:59 +0000
(17:58 -0600)
When sect_size is greater than the CONFIG_ENV_SIZE, this wild
pointer will cause CPU halt or system crash.
Fixes:
03fb08d4aef8
("env: Introduce support for MTD")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
env/mtd.c
patch
|
blob
|
history
diff --git
a/env/mtd.c
b/env/mtd.c
index
ad263ed
..
b26ee80
100644
(file)
--- a/
env/mtd.c
+++ b/
env/mtd.c
@@
-201,7
+201,7
@@
static int env_mtd_erase(void)
{
struct mtd_info *mtd_env;
u32 sect_size, sect_num;
- char *saved_buf, *tmp;
+ char *saved_buf
= NULL
, *tmp;
struct erase_info ei;
size_t ret_len;
int remaining;