mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
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:
parent
ba09ba1fce
commit
fefe985dc6
3 changed files with 6 additions and 3 deletions
|
|
@ -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)) /
|
||||
|
|
|
|||
|
|
@ -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)) /
|
||||
|
|
|
|||
|
|
@ -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)) /
|
||||
|
|
|
|||
Loading…
Reference in a new issue