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

Fix off by one bug when more data is read than buflen #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeremynorris
Copy link

This bug was discovered when /proc/stat (on a larger 56 core box) exceeded BUFSIZ=8192,
coming from codepath sigar_cpu_get(), causing a \0 to be written
one byte outside what was allocated, causing a segfault.

@haubi
Copy link

haubi commented Dec 19, 2016

Same here on some 88 core box (2x22xHyperThread). Right after boot, size of /proc/stat is ~7.5kB, not triggering this bug. This file contains lots of per-cpu-counters increasing over time, while only the first line actually is parsed. Once that file size has increased to >= 8kB, libsigar breaks.

lizhanyin added a commit to lizhanyin/sigar that referenced this pull request Aug 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants