-
Notifications
You must be signed in to change notification settings - Fork 23
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
error when decoding compressed domain name #5
Comments
Hi @jiangzhuti, thank you for all your findings. If you already have a fix, don't hesitate to come with PR. I'll appreciate it since I'm no longer working in area of telecommunication test automation and it will definitely take some time to refresh my knowledge of those RFCs and fix it properly. |
ok, I will try. This is an interesting project. |
To be able to validate your PRs and decision to change setPos(), would it be possible to share an example of call which is causing problems? I mean - fragment of code (or unit test) that fails for your "pointer-ending CNAME" packet? I could spend some time to thing about this case and see the execution flow. Allowing of buffer to point at byte which doesn't belong to it is something I'm trying to avoid. May be, there is a different approach to solve this issue - e.g. check if buffer is full or something similar. |
RFC 1035 4.1.4 says:
so when decoding a dns packet which contains a pointer-ending CNAME at the end, the code runs here: https://github.com/mnezerka/dnslib/blob/master/src/buffer.cpp#L287
saveBuffPos
is equal to the buffer's size, then, at line 290setPos(saveBuffPos);
, an exception is thrown.The text was updated successfully, but these errors were encountered: