spiFlash: workaround for dump > 1M

This commit is contained in:
Gwenhael Goavec-Merou 2021-10-02 19:25:04 +02:00
parent fe1634897f
commit 28cbd1faad
1 changed files with 4 additions and 0 deletions

View File

@ -146,6 +146,10 @@ bool SPIFlash::dump(const std::string &filename, const int &base_addr,
if (rd_burst == 0)
rd_burst = len;
/* segfault with buffer > 1M */
if (rd_burst > 0x100000)
rd_burst = 0x100000;
std::string data;
data.resize(rd_burst);