-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Sending a payload of (2^24−1) bytes #514
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
Comments
Did you get hit by this or did you find it while reading the code? |
This test has no effect on this issue.
In readPacket:
here, the pktLen is zero, but it's the last chunk length of the packet. |
Thanks for the report! |
We should add packet_test.go, so could easily inject a boundary case. |
Would it make sense to fuzz the protocol implementation? |
@dgryski that might make sense - and it is definitely desirable. I lack practical experience with fuzzing - but I really enjoy your articles and wanted to get my feet wet (or warm and fuzzy) for quite some time, so I'm game if you want to collaborate - I'd love to learn. Right now I don't have a clue how to even start fuzzing the driver - and we lack the hardware. But I have some conceptual questions first: Can it handle packet types and the transitions between them? Does it have to? |
There are a few different kinds of fuzzing. The first one is just searching for things like crashes, hangs, etc. That's very easy to do with go-fuzz, and is basically documented here: https://medium.com/@dgryski/go-fuzz-jiasu.xzqcsaa.nyc.mn-arolek-ase-3c74d5a3150c . For the SQL driver, we'd probably want to fuzz the various Other kinds of randomized tests certainly could be constructed using a "real" mysql-server and the official, C-based driver to match behaviour but I think that's a much larger project. |
We need a packet_test.go(white-box) file before fuzz(black-box), and it's easier for the rest to test the 'doubt point'. |
See Pull Request #516 |
PR #516 just added unit tests for |
Issue description
By reference:
https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html
Sending a payload of 16 777 215 (2^24−1) bytes looks like:
In this case, readPacket will get an unexpected error in:
https://github.com/go-sql-driver/mysql/blob/master/packets.go#L41
The text was updated successfully, but these errors were encountered: