Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/uefisign/pe.c
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | parse_section_table(struct executable *x, off_t off, int number_of_sections) | ||||
if (number_of_sections >= MAX_SECTIONS) { | if (number_of_sections >= MAX_SECTIONS) { | ||||
errx(1, "too many sections: got %d, should be %d", | errx(1, "too many sections: got %d, should be %d", | ||||
number_of_sections, MAX_SECTIONS); | number_of_sections, MAX_SECTIONS); | ||||
} | } | ||||
x->x_nsections = number_of_sections; | x->x_nsections = number_of_sections; | ||||
for (i = 0; i < number_of_sections; i++) { | for (i = 0; i < number_of_sections; i++) { | ||||
if (psh->psh_pointer_to_raw_data < x->x_headers_len) | if (psh->psh_size_of_raw_data > 0 && | ||||
psh->psh_pointer_to_raw_data < x->x_headers_len) | |||||
errx(1, "section points inside the headers"); | errx(1, "section points inside the headers"); | ||||
range_check(x, psh->psh_pointer_to_raw_data, | range_check(x, psh->psh_pointer_to_raw_data, | ||||
psh->psh_size_of_raw_data, "section"); | psh->psh_size_of_raw_data, "section"); | ||||
#if 0 | #if 0 | ||||
printf("section %d: start %d, size %d\n", | printf("section %d: start %d, size %d\n", | ||||
i, psh->psh_pointer_to_raw_data, psh->psh_size_of_raw_data); | i, psh->psh_pointer_to_raw_data, psh->psh_size_of_raw_data); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 316 Lines • Show Last 20 Lines |