fix(xattr): Handle labels without value

I stumbled over this with the very first image I tried:

> sudo systemd-pull oci --system quay.io/toolbx/arch-toolbox:latest

That failed with a label "user.overlay.origin" with a value of NULL and size 0.

This one-line change allows value == NULL if size == 0 when setting xattrs.

(cherry picked from commit 885fe07ee37cff7316680b5088d11081e01813b1)
This commit is contained in:
Tobias Hunger
2026-10-16 11:36:32 +01:00
committed by Luca Boccassi
parent d5c945bddb
commit c74f6f85ed
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -295,7 +295,7 @@ int xsetxattr_full(
assert(fd >= 0 || fd == AT_FDCWD);
assert((at_flags & ~(AT_SYMLINK_FOLLOW|AT_EMPTY_PATH)) == 0);
assert(name);
assert(value);
assert(value || size == 0);
if (size == SIZE_MAX)
size = strlen(value);