This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA: Have gold's File_read::do_read() function check the start parameter (PR 23765)
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 2 Sep 2019 21:56:05 -0700
- Subject: Re: RFA: Have gold's File_read::do_read() function check the start parameter (PR 23765)
- References: <87v9vaph7i.fsf@redhat.com>
> Attached is a small proposed patch for PR 23765. The C++ coding may
> not be all that good as I am not a C++ expert, but it does build and
> test without introducing any new regressions.
>
> OK to apply ?
>
> Cheers
> Nick
>
> gold/ChangeLog
> 2019-08-06 Nick Clifton <nickc@redhat.com>
>
> PR 23765
> * fileread.cc (File_read::do_read): Check start parameter before
> computing number of bytes to read.
At this level, it's not really feasible to print a meaningful error
message for the user. I'd prefer that we use gold_assert() here, and
put error checks at the higher layers to ensure that if we get to this
point it truly is an internal error.
If it can wait, I'll extend the patch to do that when I'm back again.
-cary