sendfile_len: fix bounds check.

We want to check whether the next call we make will try to send more
than 1<<30 bytes, not whether the total number of bytes to transfer is
more than that.

Interestingly, the read() fallback implementation already has the right
check, presumably because files larger than libbuf are commonplace,
whereas files larger than 1<<30 bytes are not.

Tested locally using truncate to create a 2GiB file (which works) and a
2.5GiB file (which does not work), tar to create the tarfile, and then
tar to extract them.

Bug: https://issuetracker.google.com/356578798
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0c71a6fc1014ec23f1d9cf89a68d7f0b6708aa7b)
Merged-In: Ie4c8a87b2b3fa7fa50047ef143a8cdd84186e5cc
Change-Id: Ie4c8a87b2b3fa7fa50047ef143a8cdd84186e5cc
1 file changed