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

Long lines troubles #148

Closed
mk13337 opened this issue Nov 2, 2023 · 3 comments
Closed

Long lines troubles #148

mk13337 opened this issue Nov 2, 2023 · 3 comments

Comments

@mk13337
Copy link

mk13337 commented Nov 2, 2023

Too long lines in the file lead to the following error: bufio.Scanner: token too long
Unfortunately, I can't provide nmap XML scans for privacy reasons, but this problem occurs when converting large files (tested on a file of about 30MB).
This error is contained in the formatter/file.go file, because the buffer sizes for reading lines were not specified.
Suggestions for fixing this bug were offered in the merge request #147

Additional resources:
https://stackoverflow.com/questions/21124327/how-to-read-a-text-file-line-by-line-in-go-when-some-lines-are-long-enough-to-ca

@vdjagilev
Copy link
Owner

Hey @MiichaelKlimenko !
Thanks for reporting the issue, I've took a bit different approach #149 can you check that solution as well? XML unmarshaling is not very effective on large files, so I thought I could resolve multiple problems at the same time.

@mk13337
Copy link
Author

mk13337 commented Nov 3, 2023

Thanks for the reply!
Yes, I confirm that your solution #149 works as well.
In addition, the conversion has become noticeably faster.

@vdjagilev
Copy link
Owner

Fixed in #149
https://github.com/vdjagilev/nmap-formatter/releases/tag/v2.1.5

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

No branches or pull requests

2 participants