You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The program finishing and printing somme dummy data with an error
What did you see instead?
panic: runtime error: slice bounds out of range [:1] with capacity 0
goroutine 1 [running]:
bufio.ScanBytes(...)
/usr/local/go-faketime/src/bufio/scan.go:294
main.main()
/tmp/sandbox1582258977/prog.go:11 +0x1a
Program exited.
This is not a bug that needs to be fixed. Code is not expected to call ScanBytes directly. The ScanBytes function exists to pass to Scanner.Split. If there is a way to pass ScanBytes to Scanner.Split and then have ScanBytes panic, then that should definitely be fixed. But direct calls of ScanBytes are weird, and are expected to pass valid values. A panic is a reasonable result of calling the function incorrectly.
I'm going to close this issue. Please comment if you disagree.
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?
Run https://go.dev/play/p/uLom6FqbZYj
What did you expect to see?
The program finishing and printing somme dummy data with an error
What did you see instead?
Fix could be something like
Found by https://github.com/catenacyber/ngolo-fuzzing on oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46314
The text was updated successfully, but these errors were encountered: