• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

drakenclimber / libcgroup / 20936479223
56%
main: 56%

Build:
Build:
LAST BUILD BRANCH: alert-autofix-11
DEFAULT BRANCH: main
Ran 12 Jan 2026 10:02PM UTC
Jobs 5
Files 39
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jan 2026 10:00PM UTC coverage: 56.221%. Remained the same
20936479223

push

github

drakenclimber
api: Fix unsafe call to strncat in cgroup_get_procs() and cgroup_get_threads()

TJH - the text below was autogenerated by Copilot.

In general, when using strncat, the third argument must reflect the
remaining space in the destination buffer minus one byte to keep room
for the terminating NUL. The correct upper bound is therefore
sizeof(dest) - strlen(dest) - 1. This ensures strncat cannot write past
the end of the buffer, even including the terminator it always appends.

For this code, the minimal, behavior-preserving fix is to adjust the
strncat calls that append constant suffixes to cgroup_path.
Specifically:

In cgroup_get_procs, change FILENAME_MAX - strlen(cgroup_path) to
FILENAME_MAX - strlen(cgroup_path) - 1.
In cgroup_get_threads, make the same adjustment.
No other logic needs to change; the functions will still append the same
suffixes, but the maximum number of characters strncat is allowed to
copy will correctly reserve one byte for the NUL terminator. If
cg_build_path already fills nearly the entire buffer, the new limit
prevents overflow and may result in a truncated path; if such truncation
should be handled explicitly, additional error checks on
strlen(cgroup_path) relative to FILENAME_MAX could be added, but that
would go beyond the minimal fix requested.

These changes are all within src/api.c, in the region containing
cgroup_get_procs and cgroup_get_threads, and do not require any new
includes or helper functions.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>

1 of 2 new or added lines in 1 file covered. (50.0%)

5608 of 9975 relevant lines covered (56.22%)

568.63 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
61.74
0.0% src/api.c
Jobs
ID Job ID Ran Files Coverage
1 No Container Tests - 20936479223.1 12 Jan 2026 10:03PM UTC 37
37.32
GitHub Action Run
2 Container Tests - 20936479223.2 12 Jan 2026 10:03PM UTC 28
35.46
GitHub Action Run
3 Sudo Tests - 20936479223.3 12 Jan 2026 10:03PM UTC 37
31.67
GitHub Action Run
4 No systemd Functional Tests - 20936479223.4 12 Jan 2026 10:03PM UTC 28
46.61
GitHub Action Run
5 Unit Tests - 20936479223.5 12 Jan 2026 10:02PM UTC 37
11.11
GitHub Action Run
Source Files on build 20936479223
  • Tree
  • List 39
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2302d594 on github
  • Prev Build on main (#20863027504)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc