This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PerlIO::via: sanity check READ method return value
Coverity complained that the range of SvIV(result) could be large
and well outside the bounds of the buffer at SvPVX().
So sanity check that the value of result is within range, if it is
out of range warn and return an error.
Also document the bottom of the range of expected return values from
READ, -1 is less than $len and resulted in a crash.
Ideally we'd just use the length of the modified $buffer to avoid
such range errors, but the API is already designed, so we can't.
CID 453853