Skip to content

Commit 0a34f56

Browse files
committed
@CHOB-HET and @inetknght's review
1 parent 1d8a9f6 commit 0a34f56

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/bncsutil/pe.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,17 +406,16 @@ MEXP(int) cm_pe_fixed_version(cm_pe_t pe, cm_pe_res_t* res,
406406
// find ".rsrc" section
407407
cm_pe_section_t* sect = pe->sections;
408408
{
409-
int i,RsrcFound = 0;
410-
for(i=0; i<pe->header.section_count; i++)
409+
int i=0;
410+
for(; i<pe->header.section_count; ++i)
411411
{
412-
if(strcmp(sect->name,".rsrc")==0)
412+
if(strncmp(sect[i].name,".rsrc",sizeof(sect[i].name))==0)
413413
{
414-
RsrcFound = 1;
414+
sect = &sect[i];
415415
break;
416416
}
417-
sect += 1;
418417
}
419-
if(RsrcFound==0) // no resources ???
418+
if(i == pe->header.section_count) // no resources ???
420419
return 0;
421420
}
422421
#if BIGENDIAN

0 commit comments

Comments
 (0)