Skip to content

Commit

Permalink
[fix][flash] fix 2 buffer overflows
Browse files Browse the repository at this point in the history
Signed-off-by: qwang <[email protected]>
  • Loading branch information
ivq authored and sakumisue committed Oct 27, 2023
1 parent 7658b6b commit c2d9f86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/lhal/src/flash/bflb_sflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ void ATTR_TCM_SECTION bflb_sflash_set_burst_wrap(spi_flash_cfg_type *flash_cfg)
dummy_clks = flash_cfg->burst_wrap_cmd_dmy_clk;
cmd = flash_cfg->burst_wrap_cmd;
wrap_data = flash_cfg->burst_wrap_data;
arch_memcpy4((uint32_t *)flash_ctrl_buf, &wrap_data, 4);
arch_memcpy4((uint32_t *)flash_ctrl_buf, &wrap_data, 1);
flash_cmd.cmd_buf[0] = (cmd << 24);
flash_cmd.rw_flag = SF_CTRL_WRITE;
flash_cmd.dummy_clks = dummy_clks;
Expand Down Expand Up @@ -1169,7 +1169,7 @@ void ATTR_TCM_SECTION bflb_sflash_disable_burst_wrap(spi_flash_cfg_type *flash_c
dummy_clks = flash_cfg->de_burst_wrap_cmd_dmy_clk;
cmd = flash_cfg->de_burst_wrap_cmd;
wrap_data = flash_cfg->de_burst_wrap_data;
arch_memcpy4((uint32_t *)flash_ctrl_buf, &wrap_data, 4);
arch_memcpy4((uint32_t *)flash_ctrl_buf, &wrap_data, 1);
flash_cmd.cmd_buf[0] = (cmd << 24);
flash_cmd.rw_flag = SF_CTRL_WRITE;
flash_cmd.dummy_clks = dummy_clks;
Expand Down

0 comments on commit c2d9f86

Please sign in to comment.