This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] Check file size before getting section contents
- From: Pedro Alves <palves at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Tue, 27 Jun 2017 00:26:31 +0100
- Subject: Re: [committed, PATCH] Check file size before getting section contents
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 962F280F7B
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 962F280F7B
- References: <20170626163140.GA16718@gmail.com> <222b17cb-0f15-9a65-48d7-dd096bd8ce0a@redhat.com> <726da169-8879-fe9c-4b49-c0151bf8c53c@redhat.com>
On 06/26/2017 11:24 PM, Pedro Alves wrote:
> The problem is this new "section->filepos + offset + sz"
> check here. GDB calls bfd_get_section_contents with offset != 0,
> which causes that "offset + sz" addition to shoot past filesz.
> I can't see how that new check makes sense as is. We're reading
> "count" bytes, not "sz" bytes.
>
> I'm testing this.
Testing gas+ld+gdb passed. I've pushed it in.
Thanks,
Pedro Alves