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:
committed by
Luca Boccassi
parent
d5c945bddb
commit
c74f6f85ed
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user