From 06972b6b45ff32090359d3b272f197e4cd9fb1e7 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 29 Jul 2020 13:29:16 +0200 Subject: 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 --- lib/sqfs/xattr/xattr_reader.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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); -- cgit v1.2.3