Make sure a $PIR table header has a valid length before accepting the table

as valid.

Submitted by:	Michal Mertl <mime@traveller.cz>
This commit is contained in:
John Baldwin 2002-09-09 18:24:35 +00:00
parent ba09ba1fce
commit fefe985dc6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103145
3 changed files with 6 additions and 3 deletions

View File

@ -169,7 +169,8 @@ pci_cfgregopen(void)
i < (pt->pt_header.ph_length); i++) {
ck += cv[i];
}
if (ck == 0) {
if (ck == 0 && pt->pt_header.ph_length >
sizeof(struct PIR_header)) {
pci_route_table = pt;
pci_route_count = (pt->pt_header.ph_length -
sizeof(struct PIR_header)) /

View File

@ -169,7 +169,8 @@ pci_cfgregopen(void)
i < (pt->pt_header.ph_length); i++) {
ck += cv[i];
}
if (ck == 0) {
if (ck == 0 && pt->pt_header.ph_length >
sizeof(struct PIR_header)) {
pci_route_table = pt;
pci_route_count = (pt->pt_header.ph_length -
sizeof(struct PIR_header)) /

View File

@ -169,7 +169,8 @@ pci_cfgregopen(void)
i < (pt->pt_header.ph_length); i++) {
ck += cv[i];
}
if (ck == 0) {
if (ck == 0 && pt->pt_header.ph_length >
sizeof(struct PIR_header)) {
pci_route_table = pt;
pci_route_count = (pt->pt_header.ph_length -
sizeof(struct PIR_header)) /