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

drakenclimber / libcgroup
56%
main: 56%

Build:
Build:
LAST BUILD BRANCH: alert-autofix-11
DEFAULT BRANCH: main
Repo Added 19 Nov 2020 06:53PM UTC
Files 39
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

LAST BUILD ON BRANCH alert-autofix-11
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 066
  • 3pl
  • add-cgx-man-pages
  • alert-autofix-11
  • allow-space-cgrules
  • cgall2
  • cgcompare
  • cgcompare2
  • cgconfigscript
  • cgcreate
  • cgroup-controller
  • cgroup-controller-v2
  • cgroup-controller-v3
  • cgsos
  • cgsos2
  • cgsos3
  • clang
  • cleanup-subtree
  • codeql
  • consts-rework
  • coverity
  • dependabot
  • dist-subdirs-2.0
  • distro
  • doc
  • extra-logging
  • fix-005
  • fix-cgxset
  • fix-rel2.0
  • fix008
  • fixspaces
  • fixwarning
  • fixwarnings
  • foo
  • ftest-lock
  • get_next_rule_field
  • getprocs
  • getprocs2
  • github
  • github-workflow-ci
  • issues/21
  • issues/38
  • issues/61
  • issues/62
  • issues/66
  • issues/71
  • issues/71v2
  • issues/73
  • issues/advanced-cgget
  • issues/betterlogs
  • issues/cgclear
  • issues/cgclear2
  • issues/cgconfig-tests
  • issues/cgconfigparser
  • issues/cgexec-test
  • issues/cgget-refactor
  • issues/cgget-refactor2
  • issues/cgget-tests
  • issues/cgrules
  • issues/cgrules2
  • issues/cgrules3
  • issues/cgrules4
  • issues/cgset-tests
  • issues/cgsnapshot
  • issues/cgsnapshot2
  • issues/cgv2-tests
  • issues/cgxget
  • issues/cgxget3
  • issues/cgxget4
  • issues/cgxget5
  • issues/cgxget5-pybindings
  • issues/cgxget5-pybindings3
  • issues/cgxget5-pybindings4
  • issues/cgxget5-pybindings5
  • issues/cgxget5-pybindings6
  • issues/cgxget5-toolslib
  • issues/codecovrel2.0
  • issues/codeql
  • issues/contributing
  • issues/coveralls_badge
  • issues/daemoncodecov
  • issues/delete-cgclear
  • issues/delete-legacy
  • issues/distcheck
  • issues/doxygen
  • issues/doxygen_badge
  • issues/emptycg
  • issues/emptycgcreate
  • issues/finalize
  • issues/fix-warnings
  • issues/fixcgset
  • issues/fixme
  • issues/fixmerge
  • issues/fixtest004
  • issues/fixwarnings
  • issues/ftests_cgv2
  • issues/github_actions
  • issues/improvecodecov
  • issues/kill-child
  • issues/lgtm
  • issues/lscgroup
  • issues/lssubsys
  • issues/mainbadge
  • issues/mount-pybindings
  • issues/nocontainer
  • issues/noinst
  • issues/random
  • issues/readme
  • issues/rel2-codeql
  • issues/remove-libs
  • issues/removetestsdir
  • issues/threaded
  • issues/update-map
  • issues/v2.0.1
  • issues/validate
  • leaf-node
  • linter
  • list-cgroup-mnts-api
  • main
  • master
  • memory_abstraction
  • merge-tests
  • merge-tests-3.0
  • mount-table-overflow
  • nosystemd-job
  • options
  • pids
  • ps
  • pull/44
  • pull/45
  • pull/46
  • release-2.0
  • release-3.0
  • release-3.2
  • rename-python-set-default
  • rework-testing
  • set-property
  • set-property2
  • set-property3
  • set-property4
  • setup_mode
  • systemd
  • systemd-cexample
  • systemd-cgconfig
  • systemd-cmdline
  • systemd-pythonexample
  • test
  • test-reliability
  • test2
  • tests2
  • undefsystemd
  • update-gtest
  • update-rel2-tests
  • wip/abstract_cgget2
  • wip/cgexec-test
  • wip/cgset-tests
  • wip/cgsnapshot
  • wip/cgxget
  • wip/cgxget2
  • wip/cgxget3
  • wip/cgxget4
  • wip/delete-legacy
  • wip/dist-subdirs
  • wip/empty_cgcreate2
  • wip/emptycgs
  • wip/gh_actions
  • wip/refactor_cgget2
  • wip/release-2.0
  • wip/systemd
  • wip/systemd10
  • wip/systemd11
  • wip/systemd12
  • wip/systemd2
  • wip/systemd3
  • wip/systemd4
  • wip/systemd5
  • wip/systemd6
  • wip/systemd7
  • wip/systemd8
  • wip/systemd9
  • wip/test-cgget.new
  • wip/test-cgget.old

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

Relevant lines Covered
Build:
Build:
9975 RELEVANT LINES 5608 COVERED LINES
568.63 HITS PER LINE
Source Files on main
  • Tree
  • List 39
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
20936479223 alert-autofix-11 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... push 12 Jan 2026 10:02PM UTC drakenclimber github
56.22
20928938325 update-gtest bootstrap: Update to googletest v1.17.0 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> push 12 Jan 2026 05:36PM UTC drakenclimber github
46.64
20928767419 update-gtest bootstrap: Update to googletest v1.14.0 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> push 12 Jan 2026 05:31PM UTC drakenclimber github
52.93
20928558948 update-gtest bootstrap: Update to googletest v1.15.0 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> push 12 Jan 2026 05:23PM UTC drakenclimber github
52.93
20928401962 update-gtest bootstrap: Update to googletest v1.16.0 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> push 12 Jan 2026 05:18PM UTC drakenclimber github
52.93
20928234850 update-gtest bootstrap: Update to googletest v1.17.0 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> push 12 Jan 2026 05:13PM UTC drakenclimber github
52.93
20927692526 alert-autofix-11 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... push 12 Jan 2026 04:55PM UTC drakenclimber github
56.22
20927331892 alert-autofix-11 Potential fix for code scanning alert no. 11: Potentially unsafe call to strncat Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> push 12 Jan 2026 04:43PM UTC web-flow github
56.22
20927331619 alert-autofix-11 docs: update -a flag to match uid:gid order Update cgcreate's man page so that it correctly displays the order in which the uid and gid parameters are passed in. Signed-off-by: Tomas Fabrizio Orsi <torsi@fi.uba.ar> Acked-by: Kamalesh Babulal <ka... push 12 Jan 2026 04:43PM UTC drakenclimber github
56.22
20867085047 set-property4 ftests: Add a test for setting systemd properties via cgxset Add a functional test for setting cgroup settings via cgxset and the SetUnitProperties systemd method over D-Bus. ----------------------------------------------------------------- Test... push 09 Jan 2026 10:14PM UTC drakenclimber github
57.17
See All Builds (1017)
  • Repo on GitHub
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