mirror of
https://codeberg.org/Limine/Limine
synced 2026-01-26 05:07:54 +00:00
host/limine: Fix buffer overflow in GPT-to-MBR conversion
This commit is contained in:
parent
5fa474fc0f
commit
d49c98056c
@ -818,6 +818,13 @@ static int bios_install(int argc, char *argv[]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (part_to_conv_i == 4) {
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "GPT contains more than 4 partitions, will not convert.\n");
|
||||
}
|
||||
goto no_mbr_conv;
|
||||
}
|
||||
|
||||
if (ENDSWAP(gpt_entry.starting_lba) > UINT32_MAX) {
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Starting LBA of partition %" PRIi64 " is greater than UINT32_MAX, will not convert GPT.\n", i + 1);
|
||||
@ -852,13 +859,6 @@ static int bios_install(int argc, char *argv[]) {
|
||||
goto no_mbr_conv;
|
||||
}
|
||||
|
||||
if (part_to_conv_i == 4) {
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "GPT contains more than 4 partitions, will not convert.\n");
|
||||
}
|
||||
goto no_mbr_conv;
|
||||
}
|
||||
|
||||
part_to_conv[part_to_conv_i].type = type;
|
||||
|
||||
part_to_conv_i++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user