]> git.ipfire.org Git - thirdparty/systemd.git/commit
xattr-util: rework getxattr_at_malloc()
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Mar 2025 07:36:45 +0000 (08:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Mar 2025 06:17:10 +0000 (07:17 +0100)
commit33cbda04eb4860fa14dfb9f7f046bf081f811b21
tree26aa700ffb277fe70eb575564353a97abe36e9f4
parent147511c643886543a79aa8d036380ea86c38cfa4
xattr-util: rework getxattr_at_malloc()

Let's return the size in a return parameter instead of the return value.
And if NULL is specified this tells us the caller doesn't care about the
size and expects a NUL terminated string. In that case look for an
embedded NUL byte, and refuse in that case.

This should lock things down a bit, as we'll systematically refuse
embedded NUL strings now when we expect strings.
15 files changed:
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/basic/xattr-util.c
src/basic/xattr-util.h
src/core/cgroup.c
src/home/homework-fscrypt.c
src/journal/journald-client.c
src/oom/oomd-util.c
src/oom/test-oomd-util.c
src/shared/cgroup-show.c
src/shared/copy.c
src/shared/dissect-image.c
src/shared/smack-util.c
src/test/test-copy.c
src/test/test-xattr-util.c