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

Prevent excessive memory allocation while decoding #29

Closed
breml opened this issue Dec 10, 2015 · 2 comments
Closed

Prevent excessive memory allocation while decoding #29

breml opened this issue Dec 10, 2015 · 2 comments

Comments

@breml
Copy link
Contributor

breml commented Dec 10, 2015

I played around with go-fuzz (https://github.com/dvyukov/go-fuzz) to find possible problems in this go package.

Until now I did not discover any crashes, but I found some unchecked memory allocations, where it is possible a huge amount of memory with specially crafted packets, because the respective lengths, privided in the sflow package are not checked against an upper limit.

I tried to find some reasonable maximum values and suggest:

@breml
Copy link
Contributor Author

breml commented Dec 10, 2015

Just found out, there is a better maximum value for header length: https://github.com/sflow/sflowtool/blob/bd3df6e11bdf8261a42734c619abfe8b46e1202f/src/sflowtool.h#L28

@Preetam
Copy link
Member

Preetam commented Dec 10, 2015

Thanks!

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