diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-01 15:24:37 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-01 15:30:44 +0200 |
commit | 0ec65af730f7c6307a5c8e7330a31ae2b785d95d (patch) | |
tree | 666e21da8bafa5ea796ea703e6b3b3baaa949d31 | |
parent | ca31aeea6cfe06b9e9f6476347564affe1596447 (diff) |
Fix xattr OOL position
We need to get the position _before_ writing the header, otherwise the
reader has no way to know the length of the value.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | lib/sqfs/write_xattr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqfs/write_xattr.c b/lib/sqfs/write_xattr.c index 05f2775..ce606e3 100644 --- a/lib/sqfs/write_xattr.c +++ b/lib/sqfs/write_xattr.c @@ -84,14 +84,14 @@ static int write_value(meta_writer_t *mw, const char *value, uint32_t offset; uint64_t block; + meta_writer_get_position(mw, &block, &offset); + *value_ref_out = (block << 16) | (offset & 0xFFFF); + vent.size = htole32(strlen(value)); if (meta_writer_append(mw, &vent, sizeof(vent))) return -1; - meta_writer_get_position(mw, &block, &offset); - *value_ref_out = (block << 16) | (offset & 0xFFFF); - if (meta_writer_append(mw, value, strlen(value))) return -1; |