uboot-mtk-20250711: env: mtd: initialize saved_buf pointer
When sect_size is greater than 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>
This commit is contained in:
2
uboot-mtk-20250711/env/mtd.c
vendored
2
uboot-mtk-20250711/env/mtd.c
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user