This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] strings: Produce error when section data falls outside file.
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 12 Jan 2015 22:11:55 +0100
- Subject: Re: [PATCH] strings: Produce error when section data falls outside file.
On Mon, 2014-12-29 at 01:15 +0300, Alexander Cherepanov wrote:
> On 2014-12-27 14:42, Mark Wielaard wrote:
> > On Sat, Dec 27, 2014 at 04:31:14AM +0300, Alexander Cherepanov wrote:
> >> strings.c: In function 'read_elf':
> >> strings.c:729:24: error: comparison between signed and unsigned integer
> >> expressions [-Werror=sign-compare]
> >> if (shdr->sh_offset > fdlen
> > The compiler is correct. sh_offset is an unsigned Elf64_Off and fdlen is
> > a signed off64_t. But just before we already checked fdlen >= 0, so we
> I see.
> > can just cast it to Elf64_Off safely for this comparison. As attached.
> Thanks, mjw/pending is compiling fine now.
Thanks for double checking. I pushed that patch to master now.