Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bufio.Scanner: token too long #159

Open
MatheMatrix opened this issue Jan 21, 2019 · 1 comment
Open

bufio.Scanner: token too long #159

MatheMatrix opened this issue Jan 21, 2019 · 1 comment
Labels

Comments

@MatheMatrix
Copy link

MatheMatrix commented Jan 21, 2019

When return is very long (more than 64KB), it will get an error: bufio.Scanner: token too long

This is because go-qemu/qmp/socket.go:160 uses a small default Buffer (bufio.scan.MaxScanTokenSize) while real world may much longer than that.

@RaphaelPour
Copy link

I also triggered this bug with the hmp command info mem which returns a lot more than 64KB.

Why was Scanner used in the first place? Can't the socket be just read until EOF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants