summaryrefslogtreecommitdiff
path: root/lib/systemd.c
diff options
context:
space:
mode:
authorMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>2025-01-08 10:38:56 +0100
committerMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>2025-01-08 10:38:56 +0100
commit4ed9147d98985acb5b3347ad70b31de578ac2289 (patch)
tree12df29c7612c3a58397f952dd78c855b2e690b4a /lib/systemd.c
parent21fe1f4d83502ac1c2262913c1a98441ea89bf24 (diff)
lib: Fix privs syscaps (pset_t) allocation
Don't over-allocate syscaps in zcaps2sys(): This is just a single struct (pset_t) with a count and a pointer to an array of capabilities, not an array. So only allocate a single pset_t, not num copies of it. The allocation size of syscaps->caps then needs to be based on the number of Linux capabilities (count), but that is already handled properly a few lines below. Note that this fix is mostly cosmetic and for correctness. There was no potential for memory corruption, because num is guaranteed to be nonzero. So at least the one required pset_t was always allocated (but potentially much more). Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Diffstat (limited to 'lib/systemd.c')
0 files changed, 0 insertions, 0 deletions