mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-07 08:59:13 +00:00
getxattr: trim the returned buffer to the correct size
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
7b6b494fff
commit
d9339d016a
@ -1880,6 +1880,7 @@ sub getxattr($$;$) {
|
|||||||
if ($xattr_size < 0) {
|
if ($xattr_size < 0) {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
$buf = substr($buf, 0, $xattr_size);
|
||||||
return wantarray ? ($buf, $xattr_size) : $buf;
|
return wantarray ? ($buf, $xattr_size) : $buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user