This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Have gold's File_read::do_read() function check the start parameter (PR 23765)


>   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]