propertly initialize pe_section_name_counter (#2452)

properly initialize the pe_section_name_counter

bpf2c crashes in set_pe_section_name during call to strncpy_s when provided
invalid prefix_length as count due tointeger underflow. the root cause is
pe_section_name_counter is not appropriately initialized to 0
This commit is contained in:
Tyler Retzlaff 2023-05-09 13:56:08 -07:00 коммит произвёл GitHub
Родитель b9cf492a36
Коммит e1b8ed8ea0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -397,7 +397,7 @@ class bpf_code_generator
bool bool
is_section_valid(const ELFIO::section* section); is_section_valid(const ELFIO::section* section);
int pe_section_name_counter; int pe_section_name_counter{};
std::map<unsafe_string, section_t> sections; std::map<unsafe_string, section_t> sections;
section_t* current_section; section_t* current_section;
ELFIO::elfio reader; ELFIO::elfio reader;