opt_mode == MODE_COMPRESS isn't possible when HAVE_ENCODERS isn't
defined. Thus, when *encoding*, the message about *decoder* memory
usage is possible to show only when both encoder and decoder have
been built.
Since the message is shown only at V_DEBUG, skip the memusage
calculation if verbosity level isn't high enough.
Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
(cherry picked from commit 347b412a9374e0456bef9da0d7d79174c0b6f1a5)
lzma_options_lzma.dict_size is uint32_t so use it here too.
Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
(cherry picked from commit 31358c057c9de9d6aba96bae112b2d17942de7cb)
Since 5.3.5beta, "xz --lzma2=mf=bt4,nice=2" works even though bt4 needs
at least nice=4. It is rounded up internally by liblzma when needed.
Fixes: 5cd9f0df78cc4f8a7807bf6104adea13034fbb45
(cherry picked from commit 3f71e0f3a118e1012526f94fd640a626d30cb599)
These are temporary files that are needed only when running po4a.
The top-level Makefile.am puts the whole po4a directory into
distribution tarball (it's simpler) so deleting these temporary
files is needed to prevent them from getting into tarballs.
(cherry picked from commit ab51e8ee610e2a893906859848f93d5cb0d5ba83)
It likely was a leftover from a development version of the code.
Fixes: 183819bfd9efac8c184d9bf123325719b7eee30f
(cherry picked from commit fe4d8b0c80eaeca3381be302eeb89aba871a7e7c)
It needs to find the xz executable from a different directory
and work without config.h.
(cherry picked from commit a805594ed0b4cbf7b81aa28ff46a8ab3c83c6876)
The latest stable is 3.3.0 and it's from 2014.
Don't mention the older versions in INSTALL.
3.3.0 ships with Clang already.
Testing with 3.4.0beta6 shows that tuklib_physmem
works too so omit comments about that from INSTALL.
Visibility warnigns weren't a problem either.
Thus it's enough to mention the need for --disable-threads
as configure doesn't autodetect the lack of pthreads.
(cherry picked from commit 50e19489387774bab3c4a988397d0d9c7a142a46)
It was copied if it existed. This was intentional when autogen.sh
still built liblzma API docs with Doxygen.
Fixes: d3a77ebc04bf1db8d52de2d9b0f07877bc4fd139
(cherry picked from commit 8ede961374613aa302a13571d662cfaea1cf91f7)
I've checked over each of these and they're straightforward applications
of the relevant Github Actions.
(cherry picked from commit 9a6761aa35ed84d30bd2fda2333a4fdf3f46ecdc)
This way "codespell -i 0" is silent.
This is the first commit from
https://github.com/tukaani-project/xz/pull/93
with trivial edits by Lasse Collin.
(cherry picked from commit 81efe6119f86e3274e512c9eca5ec22b2196c2b3)
This was added to xz in 02e3505991233901575b7eabc06b2c6c62a96899
but I forgot to do the same in xzdec.
The Landlock sandbox in xzdec could be stricter as now it's
active only for the last file being decompressed. In xz,
read-only sandbox is used for multi-file case. On the other hand,
xz doesn't go to the strictest mode when processing the last file
when more than one file was specified; xzdec does.
(cherry picked from commit 3334c71d3d4294a4f6569df3ba9bcf2443dfa501)
Clang 17 with -fsanitize=address,undefined:
src/liblzma/common/filter_common.c:366:8: runtime error:
call to function encoder_find through pointer to incorrect
function type 'const lzma_filter_coder *(*)(unsigned long)'
src/liblzma/common/filter_encoder.c:187: note:
encoder_find defined here
Use a wrapper function to get the correct type neatly.
This reduces the number of casts needed too.
This issue could be a problem with control flow integrity (CFI)
methods that check the function type on indirect function calls.
Fixes: 3b34851de1eaf358cf9268922fa0eeed8278d680
(cherry picked from commit 278563ef8f2b8d98d7f2c85e1a64ec1bc21d26d8)
It's undefined behavior. The result wasn't ever used as it occurred
in the last iteration of a loop.
Clang 17 with -fsanitize=address,undefined:
$ src/xz/xz --block-list=123
src/xz/args.c:164:12: runtime error: applying non-zero offset 1
to null pointer
Fixes: 88ccf47205d7f3aa314d358c72ef214f10f68b43
Co-authored-by: Sam James <sam@gentoo.org>
(cherry picked from commit 77c8f60547decefca8f2d0c905d9c708c38ee8ff)
This is disabled by default to match the default in Autotools.
Use -DUSE_DOXYGEN=ON to enable Doxygen usage.
This uses the update-doxygen script, thus this is under if(UNIX)
although Doxygen itself can run on Windows too.
(cherry picked from commit 64503cc2b76a388ced4ec5f68234a07f0dcddcd5)
This omits all comments and a few non-default options that weren't
needed. Now it contains no copyrighted content from Doxygen itself.
(cherry picked from commit 2c519f641f266fd897edf680827d9c905f411440)
The stripping method worked well with Doxygen 1.8 and 1.9 but
it doesn't work with Doxygen 1.10 anymore. Since we won't ship
pre-generated liblzma API docs anymore, the extra bloat and
extra license info of the JavaScript files won't affect the
upstream source package anymore.
(cherry picked from commit bdba39a57530d11b88440df8024002be3d09e4a1)
They will be omitted from the source tarball and I don't want
to make Doxygen a dependency of build.bash.
(cherry picked from commit 252aa1d67bc015eeba462803ab72edeb7744d864)
pdf-local rule was added to create the PDFs still with "make pdf".
The install rules are missing but that likely doesn't matter at all.
(cherry picked from commit dc684bf76ea23574ee9d88382057381e04e6089a)
This moves the tests section as is from CMakeLists.txt into
tests/tests.cmake. CMakeLists.txt now includes tests/tests.cmake
if the latter file exists.
Now it's possible to delete the whole "tests" directory and
building with CMake will still work normally, just without
the tests. This way the tests are readily available for those
who want them, and those who won't run the tests anyway have
a straightforward way to ensure that nothing from the "tests"
directory can affect the build process.
(cherry picked from commit aaff75c3486c4489ce88b0efb36b41cf138af7c3)
These are very old but the exact test file isn't easy to reproduce
as it was compiled from a short C program (bcj_test.c) long ago.
These tests weren't very good anyway, just a little better than nothing.
(cherry picked from commit a5f2aa5618fe9183706c9c514c3067985f6c338b)
On LZMA_DATA_ERROR from lzma_index_buffer_decode(), *i = NULL was
already done but this adds a test for that case too.
(cherry picked from commit 575b11b0d291e66c5fce31ce7a72f11436d57c83)
liblzma guarantees that the product of the allocation size arguments
will fit in size_t.
Putting the pre-increment in the if-statement was clearly wrong
although in practice it didn't matter here as the function is
called only a couple of times.
(cherry picked from commit 7f865577a6224fbbb5f5ca52574b62ea8ac9bf51)