<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/sqfs, branch fixes-1.1.0</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2022-12-01T17:46:52+00:00</updated>
<entry>
<title>libsqfs: Initialize the return value in sqfs_compressor_create</title>
<updated>2022-12-01T17:46:52+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-11-18T14:35:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=35170bc6adf5d140210bc26e8511cf1e1cdeb5db'/>
<id>urn:sha1:35170bc6adf5d140210bc26e8511cf1e1cdeb5db</id>
<content type='text'>
Initialize the output compressor pointer to NULL, so if the function
fails, the value is propperly initialized to a NULL pointer instead
of relying on the function user to initialize it.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libsqfs: Fix an overzealous bounds check in the block processor</title>
<updated>2022-12-01T17:46:52+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-11-18T15:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=9ae118f7c68785e3854cf68baf3177a94b70e0d6'/>
<id>urn:sha1:9ae118f7c68785e3854cf68baf3177a94b70e0d6</id>
<content type='text'>
When (during fragment deduplication) a fragment block is read back
from disk and unpacked, it can happen that it is _exactly_ the
given block size. The bounds check did '&gt;=' instead of '&gt;' and
failed in that case with a "data corruption" error.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix: guard against potential overflow in file size calculation</title>
<updated>2022-03-10T22:31:54+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-03-10T22:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=82f83c9515aaf99d12f6aa101c4d7b7463850e8b'/>
<id>urn:sha1:82f83c9515aaf99d12f6aa101c4d7b7463850e8b</id>
<content type='text'>
The block_count is a size_t, so on 32 bit platforms the multiplication
might be truncated before the comparison with filesz.

On 64 bit platforms, it could potentially also overflow the 64 bit
bounds of the data type.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix: consistently use the widechar file API on Windows</title>
<updated>2021-12-05T09:29:36+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-11-27T23:05:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=2b8eb19a4de81db470f7ff5021a8a4822cc8c80d'/>
<id>urn:sha1:2b8eb19a4de81db470f7ff5021a8a4822cc8c80d</id>
<content type='text'>
When opening files on windows, use the widechar versions and convert
from (assumed) UTF-8 to UTF-16 as needed.

Since the broken, code-page-random API may acutall be intended in some
use cases, leave that option in through an additional flag.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Tighten bounds checks in sqfs_dir_reader_reader</title>
<updated>2021-08-22T11:45:15+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-08-22T11:40:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=3ef7c3bb37e40de2653daf306e8bcb2a87446271'/>
<id>urn:sha1:3ef7c3bb37e40de2653daf306e8bcb2a87446271</id>
<content type='text'>
Use the same size check as sqfs_dir_reader_open_dir and report EOF,
even if it is possible to read the header itself, but nothing beyond
that.

Also check if it should be possible to read an entry header before
attempting and report EOF if not.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix half done initialization of sqfs_dir_reader_open_dir</title>
<updated>2021-08-22T11:45:11+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-08-22T11:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=93f17ac5382be1102151fe1322ce90e85665e161'/>
<id>urn:sha1:93f17ac5382be1102151fe1322ce90e85665e161</id>
<content type='text'>
The sqfs_dir_reader_open_dir function tried to take a short-cut by
returning early if the target directory is empty. However, this left
some field unchanged from the previous directory.

If iterating over a directory and then deciding to enter a sub-directory
that happens to be empty, the directory reader will keep the settings
for the current directory. After calling sqfs_dir_reader_rewind, the
sub-directory will suddenly report the contents of the parent.

A similar check is added to the rewind function to not track back on
the meta data reader in that case.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix libsquashfs directory writer size accounting</title>
<updated>2021-07-21T07:56:31+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-07-21T07:41:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=248494992442fbde7eb6ca3979a778d82fa86016'/>
<id>urn:sha1:248494992442fbde7eb6ca3979a778d82fa86016</id>
<content type='text'>
The squashfs readdir() implementation in the Linux kernel returns
non-existing "." and ".." entries for offsets 0 and 1, and after
that reads from disk. For convenience, it was decided to store an
off-by-3 value on disk instead of doing complex primary school math
to adjust for this. This didn't show up until now, because the kernel
implementation trusts the value from the directory header more than
the actual size in the inode and happily reads 3 more than the inode
would allow it to. This only showed up with 7-zip which subtracts 3
from the size and expects the result to be exact and bails if the
directory headers suggest otherwise.

And yes, I did consider making a "Holy Hand Granade of Antioch"
reference, but consciously decided not to.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add default cases for every switch block</title>
<updated>2021-06-25T13:12:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-25T12:14:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=d4690eeabe557753b394b8f83b5dbaf83e57e15f'/>
<id>urn:sha1:d4690eeabe557753b394b8f83b5dbaf83e57e15f</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Remove casual un-const casting in various places</title>
<updated>2021-06-25T13:12:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-24T14:07:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=8348086b48af0cbabe4cf2b64992ced6561ea50c'/>
<id>urn:sha1:8348086b48af0cbabe4cf2b64992ced6561ea50c</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libsquashfs: get rid of potentially unaligned access and VLAs</title>
<updated>2021-06-25T13:12:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-25T12:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=41dc1dfaa0a290ef62800e603bb6b51a48501129'/>
<id>urn:sha1:41dc1dfaa0a290ef62800e603bb6b51a48501129</id>
<content type='text'>
The same problem with the meta data header again, 16 bit read from
a buffer: copy the buffer data into a 16 bit variable instead of
casting to something potentially unaligned.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
