Skip to content

Commit

Permalink
off_t is signed and long; keep the long when discarding the signed.
Browse files Browse the repository at this point in the history
#127
	modified:   p_vmlinx.cpp
  • Loading branch information
jreiser committed Oct 1, 2017
1 parent 26be845 commit 3931cb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/p_vmlinx.cpp
Expand Up @@ -111,7 +111,8 @@ typename T::Shdr const *PackVmlinuxBase<T>::getElfSections()
int j;
for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) {
if (Shdr::SHT_STRTAB==p->sh_type
&& (p->sh_size + p->sh_offset) <= (unsigned) file_size
&& (p->sh_size + p->sh_offset) <= (unsigned long)file_size
&& p->sh_name < p->sh_size
&& (10+ p->sh_name) <= p->sh_size // 1+ strlen(".shstrtab")
) {
delete [] shstrtab;
Expand Down

0 comments on commit 3931cb7

Please sign in to comment.