aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/xattr
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-07-29 13:29:16 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-07-29 13:31:08 +0200
commit06972b6b45ff32090359d3b272f197e4cd9fb1e7 (patch)
tree1ffeee2d6ce291e757a37ca24cf8d2a9965932df /lib/sqfs/xattr
parent79fb53e4497965a9cf02f31af38db3bc6b2b1fb7 (diff)
Fix: xattr reader: read the header after seaking to an OOL value
If an xattr value is stored OOL, the value actually holds an 8 byte reference to another, previously stored value. This reference points to the header that we need to read to know the actual size of the value before reading it, not the value itself, so after reading the reference and seeking to it, the xattr reader needs to read the actual header. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/xattr')
-rw-r--r--lib/sqfs/xattr/xattr_reader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqfs/xattr/xattr_reader.c b/lib/sqfs/xattr/xattr_reader.c
index 37f222a..d3adc46 100644
--- a/lib/sqfs/xattr/xattr_reader.c
+++ b/lib/sqfs/xattr/xattr_reader.c
@@ -256,6 +256,10 @@ int sqfs_xattr_reader_read_value(sqfs_xattr_reader_t *xr,
ret = sqfs_meta_reader_seek(xr->kvrd, new_start, new_offset);
if (ret)
return ret;
+
+ ret = sqfs_meta_reader_read(xr->kvrd, &value, sizeof(value));
+ if (ret)
+ return ret;
}
value.size = le32toh(value.size);