1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-22 04:49:46 +01:00

fix: flush SquashFS meta block if *exactely* filled

Otherwise we can get really funky corner cases where an inode offset is
indicated as just 1 byte after the end of a block. The unsquashfs program
doesn't complain but the kernel implementation really doesn't like that.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-04-23 13:52:26 +02:00
parent 7a70868fcd
commit ed6841ed17

View file

@ -85,5 +85,8 @@ int meta_writer_append(meta_writer_t *m, const void *data, size_t size)
data = (const char *)data + diff; data = (const char *)data + diff;
} }
if (m->offset == (sizeof(m->data) - 2))
return meta_writer_flush(m);
return 0; return 0;
} }