Fix #3444 - Fix infinite loop in PE parser

This commit is contained in:
pancake 2015-10-12 19:42:44 +02:00
parent f9b661f839
commit 60b60aa50a

View File

@ -1774,11 +1774,11 @@ struct r_bin_pe_export_t* PE_(r_bin_pe_get_exports)(struct PE_(r_bin_pe_obj_t)*
if (bin->export_directory->NumberOfNames!=0) {
// search for value of i into AddressOfOrdinals
name_vaddr=0;
for(n=0;n<bin->export_directory->NumberOfNames;n++) {
for (n=0; n<bin->export_directory->NumberOfNames;n++) {
int ret = r_buf_read_at (bin->b,
ordinals_paddr + n * sizeof(PE_Word),
(ut8*)&function_ordinal,sizeof (PE_Word));
if (!ret) break;
if (ret<1) break;
// if exist this index into AddressOfOrdinals
if (i==function_ordinal) {
// get the VA of export name from AddressOfNames