Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBR: Fix issue with MBR init asserting on bad partition size #7299

Merged
merged 1 commit into from Jun 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion features/filesystem/bd/MBRBlockDevice.cpp
Expand Up @@ -241,7 +241,9 @@ int MBRBlockDevice::init()
_size = fromle32(table->entries[_part-1].lba_size) * sector;

// Check that block addresses are valid
MBED_ASSERT(_bd->is_valid_erase(_offset, _size));
if (!_bd->is_valid_erase(_offset, _size)) {
return BD_ERROR_INVALID_PARTITION;
}

delete[] buffer;
return 0;
Expand Down