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

Possible overflow in sprint_realloc_timeticks #173

Closed
sgmr29 opened this issue Aug 26, 2020 · 1 comment
Closed

Possible overflow in sprint_realloc_timeticks #173

sgmr29 opened this issue Aug 26, 2020 · 1 comment

Comments

@sgmr29
Copy link

sgmr29 commented Aug 26, 2020

Regarding these lines:

net-snmp/snmplib/mib.c

Lines 1195 to 1196 in 8fdec0d

char str[32];
sprintf(str, "Timeticks: (%lu) ", *(u_long *) var->val.integer);

The format string contains 14 constant characters, and a 64 bit unsigned integer could take 20 characters, and then you need a null terminator. That's 35 by my count, which would be bigger than the buffer.

@nielsb
Copy link
Contributor

nielsb commented Aug 26, 2020 via email

@sgmr29 sgmr29 closed this as completed Aug 26, 2020
bvanassche added a commit that referenced this issue Aug 27, 2020
This patch suppresses certain static analyzer complaints. See also
#173 .
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