We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac6ca73 commit d32b454Copy full SHA for d32b454
features/storage/blockdevice/MBRBlockDevice.cpp
@@ -73,6 +73,12 @@ static int partition_absolute(
73
{
74
// Allocate smallest buffer necessary to write MBR
75
uint32_t buffer_size = std::max<uint32_t>(bd->get_program_size(), sizeof(struct mbr_table));
76
+
77
+ // Prevent alignment issues
78
+ if(buffer_size % bd->get_program_size() != 0) {
79
+ buffer_size += bd->get_program_size() - (buffer_size % bd->get_program_size());
80
+ }
81
82
uint8_t *buffer = new uint8_t[buffer_size];
83
84
// Check for existing MBR
0 commit comments