Add bios area range check (lower side).

This commit is contained in:
takawata 2002-03-23 06:44:04 +00:00
parent c22315924b
commit cfea68cc25
2 changed files with 4 additions and 2 deletions

View File

@ -93,7 +93,8 @@ bios32_init(void *junk)
ck += cv[i];
}
/* If checksum is OK, enable use of the entrypoint */
if ((ck == 0) && (sdh->entry < (BIOS_START + BIOS_SIZE))) {
if ((ck == 0) && (BIOS_START <= sdh->entry ) &&
(sdh->entry < (BIOS_START + BIOS_SIZE))) {
bios32_SDCI = BIOS_PADDRTOVADDR(sdh->entry);
if (bootverbose) {
printf("bios32: Found BIOS32 Service Directory header at %p\n", sdh);

View File

@ -93,7 +93,8 @@ bios32_init(void *junk)
ck += cv[i];
}
/* If checksum is OK, enable use of the entrypoint */
if ((ck == 0) && (sdh->entry < (BIOS_START + BIOS_SIZE))) {
if ((ck == 0) && (BIOS_START <= sdh->entry ) &&
(sdh->entry < (BIOS_START + BIOS_SIZE))) {
bios32_SDCI = BIOS_PADDRTOVADDR(sdh->entry);
if (bootverbose) {
printf("bios32: Found BIOS32 Service Directory header at %p\n", sdh);