File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -359,9 +359,11 @@ static int process_validateElf32(void *iehdr, size_t size)
359359 return - ENOEXEC ;
360360 }
361361 for (i = 0 ; i < ehdr -> e_phnum ; i ++ ) {
362- if ((phdr -> p_type != PT_LOAD ) &&
363- (process_isPtrValid (iehdr , size , ((char * )ehdr ) + phdr [i ].p_offset , phdr [i ].p_filesz ) == 0 )) {
364- return - ENOEXEC ;
362+ if (phdr -> p_type != PT_LOAD ) {
363+ if (process_isPtrValid (iehdr , size , ((char * )ehdr ) + phdr [i ].p_offset , phdr [i ].p_filesz ) == 0 ) {
364+ return - ENOEXEC ;
365+ }
366+ continue ;
365367 }
366368
367369 offs = phdr -> p_offset & ~(phdr -> p_align - 1 );
@@ -432,9 +434,11 @@ static int process_validateElf64(void *iehdr, size_t size)
432434 return - ENOEXEC ;
433435 }
434436 for (i = 0 ; i < ehdr -> e_phnum ; i ++ ) {
435- if ((phdr -> p_type != PT_LOAD ) &&
436- (process_isPtrValid (iehdr , size , ((char * )ehdr ) + phdr [i ].p_offset , phdr [i ].p_filesz ) == 0 )) {
437- return - ENOEXEC ;
437+ if (phdr -> p_type != PT_LOAD ) {
438+ if (process_isPtrValid (iehdr , size , ((char * )ehdr ) + phdr [i ].p_offset , phdr [i ].p_filesz ) == 0 ) {
439+ return - ENOEXEC ;
440+ }
441+ continue ;
438442 }
439443
440444 offs = phdr -> p_offset & ~(phdr -> p_align - 1 );
You can’t perform that action at this time.
0 commit comments