aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/xattr_writer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqfs/xattr_writer.c b/lib/sqfs/xattr_writer.c
index 318c613..fd35ca3 100644
--- a/lib/sqfs/xattr_writer.c
+++ b/lib/sqfs/xattr_writer.c
@@ -235,6 +235,10 @@ int sqfs_xattr_writer_end(sqfs_xattr_writer_t *xwr, sqfs_u32 *out)
int ret;
count = xwr->num_pairs - xwr->kv_start;
+ if (count == 0) {
+ *out = 0xFFFFFFFF;
+ return 0;
+ }
qsort(xwr->kv_pairs + xwr->kv_start, count,
sizeof(xwr->kv_pairs[0]), compare_u64);