mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
StorageManager: fixed hang in erase()
found by coverity
This commit is contained in:
parent
4eab27abe9
commit
81e6d88560
@ -97,7 +97,7 @@ void StorageManager::erase(void)
|
||||
const StorageManager::StorageArea &area = StorageManager::layout[i];
|
||||
uint16_t length = pgm_read_word(&area.length);
|
||||
uint16_t offset = pgm_read_word(&area.offset);
|
||||
for (uint8_t ofs=0; length; ofs += sizeof(blk)) {
|
||||
for (uint16_t ofs=0; ofs<length; ofs += sizeof(blk)) {
|
||||
uint8_t n = 16;
|
||||
if (ofs + n > length) {
|
||||
n = length - ofs;
|
||||
|
Loading…
Reference in New Issue
Block a user