x/text/transform: errInconsistentByteCount should be returned by too big nSrc #31486
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The point is that the
Transform()
returns invalidnSrc
.What did you expect to see?
The
Read()
should returntransform.errInconsistentByteCount
because theTransform()
returns invalidnSrc
(nSrc > len(src)
). The code comment saysThe error is suitable for this case.
What did you see instead?
It panics with
slice bounds out of range
.The stack trace points the internal of the library, not the implementation of Transformer. This behavior makes difficult to debug because the real problem is in the use of transform package, but the error doesn't suggest that.
The text was updated successfully, but these errors were encountered: