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

Infinite loop due to integer overflow #210

Closed
wengyusu opened this issue Nov 18, 2020 · 1 comment
Closed

Infinite loop due to integer overflow #210

wengyusu opened this issue Nov 18, 2020 · 1 comment

Comments

@wengyusu
Copy link

#207

if ((max >= 0 && ((int)newname[*length - 1] > max)) ||

when operating GETNEXT to the OID 1.3.6.1.4.1.2021.9.1.1.4294967295, the (int)newname[*length - 1] becomes -1 since newname[*length - 1]=4294967295(0XFFFFFFFF) that breaks the comparison and causes an infinite loop. As a result, the SNMPD will stuck, and CPU usage reaches 100%.

bvanassche added a commit that referenced this issue Nov 19, 2020
Process GETNEXT for OIDs like 1.3.6.1.4.1.2021.9.1.1.4294967295 correctly.
Additionally, handle *length == 0 correctly.

See also #210 .
@bvanassche
Copy link
Contributor

Please take a look at commit ebe677e.

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