]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
34 hours agoUpdate THANKS master
Lasse Collin [Tue, 21 Jul 2026 10:56:42 +0000 (13:56 +0300)] 
Update THANKS

34 hours agoxz: Free the filename read from the file specified with --files/--files0
Lasse Collin [Tue, 21 Jul 2026 10:50:13 +0000 (13:50 +0300)] 
xz: Free the filename read from the file specified with --files/--files0

Like the previous commit, this cleans up leak detection slightly.
Otherwise it doesn't matter because xz is going to exit soon anyway.

34 hours agoxz: Free the filename allocated for --files or --files0
Lasse Collin [Tue, 21 Jul 2026 10:32:05 +0000 (13:32 +0300)] 
xz: Free the filename allocated for --files or --files0

This cleans up leak detection slightly. Otherwise it doesn't matter
because xz is going to exit soon anyway.

Reported-by: Phuc An
Fixes: https://github.com/tukaani-project/xz/pull/232
35 hours agoliblzma: Fix input_size_max in lzma_index_buffer_decode()
Lasse Collin [Tue, 21 Jul 2026 09:58:45 +0000 (12:58 +0300)] 
liblzma: Fix input_size_max in lzma_index_buffer_decode()

If *in_pos > 0, the condition became more relaxed than it needed to be.

Fixes: 5005914f1acf ("liblzma: Index decoder: Reject an obviously-bad Number of>
Fixes: 0352dc7929b1 ("liblzma: Silence a compiler warning")
2 days agoTests: Fix test_index.c when encoding support is disabled
Lasse Collin [Mon, 20 Jul 2026 19:29:58 +0000 (22:29 +0300)] 
Tests: Fix test_index.c when encoding support is disabled

Fixes: 10dfae83fd3b ("Tests: test_index: Add a test for the Index decoder memusage bug")
2 days agoliblzma: Silence a compiler warning
Lasse Collin [Mon, 20 Jul 2026 19:14:05 +0000 (22:14 +0300)] 
liblzma: Silence a compiler warning

Fixes: 5005914f1acf ("liblzma: Index decoder: Reject an obviously-bad Number of Records better")
2 days agoTests: test_index: Test the stricter Number of Records condition
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
Tests: test_index: Test the stricter Number of Records condition

2 days agoTests: Add test file bad-0-index-1.xz
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
Tests: Add test file bad-0-index-1.xz

2 days agoRevert "liblzma: Add internal constant INDEX_RECORDS_MAX"
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
Revert "liblzma: Add internal constant INDEX_RECORDS_MAX"

This reverts commit 9ff4dadca96a5ac3cb478759a4fdb8663be114eb.
The INDEX_RECORDS_MAX constant isn't needed after the previous commit.

2 days agoliblzma: Index decoder: Reject an obviously-bad Number of Records better
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
liblzma: Index decoder: Reject an obviously-bad Number of Records better

File info decoder knows Backward Size, so pass it to the Index decoder.
Now the Index decoder, when called from the file info decoder, won't
allocate a large amount of memory when Backward Size is tiny and the
Number of Records field contains a huge invalid value.

If a reasonable memory usage limit was set, the old code returned
LZMA_MEMLIMIT_ERROR if the value in Number of Records was too huge.
Now it results in LZMA_DATA_ERROR which is better.

2 days agoTests: test_index: Add a test for the Index decoder memusage bug
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
Tests: test_index: Add a test for the Index decoder memusage bug

2 days agoliblzma: Index decoder: Fix lzma_memusage()
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
liblzma: Index decoder: Fix lzma_memusage()

If lzma_stream was initialized using lzma_index_decoder() or
lzma_file_info_decoder(), and lzma_memusage() was called after a few
Records had already been decoded, the return value was too low because
it was calculated based on the number of Records that haven't been
decoded yet. So near the end of a big Index, the return value would be
tiny compared to the actual memory usage.

It worked correctly in the primary use case, that is, after
LZMA_MEMLIMIT_ERROR. Thus, in practice this bug didn't matter much.

2 days agoTests: test_index: Fix testing of _locate() with concatenated lzma_index
Lasse Collin [Mon, 20 Jul 2026 17:00:06 +0000 (20:00 +0300)] 
Tests: test_index: Fix testing of _locate() with concatenated lzma_index

3 days agoTranslations: Update the Brazilian Portuguese translation
Lasse Collin [Sun, 19 Jul 2026 07:44:49 +0000 (10:44 +0300)] 
Translations: Update the Brazilian Portuguese translation

3 days agoliblzma: Remove an outdated API doc in hardware.h
Lasse Collin [Wed, 15 Jul 2026 19:12:07 +0000 (22:12 +0300)] 
liblzma: Remove an outdated API doc in hardware.h

2 weeks agoTests: Comment that a sanitizer may be needed for lzma_index_append() bug
Lasse Collin [Fri, 3 Jul 2026 13:55:03 +0000 (16:55 +0300)] 
Tests: Comment that a sanitizer may be needed for lzma_index_append() bug

Fixes: a3ea8832bec1 ("Tests: Add a test for the lzma_index_prealloc() + lzma_index_append() bug")
Link: https://github.com/tukaani-project/xz/issues/233
2 weeks agoTranslations: Update the Croatian translation
Lasse Collin [Thu, 2 Jul 2026 18:56:33 +0000 (21:56 +0300)] 
Translations: Update the Croatian translation

2 weeks agoNEWS: Clarify which bug is CVE-2026-34743 v5.8
Lasse Collin [Thu, 2 Jul 2026 18:09:36 +0000 (21:09 +0300)] 
NEWS: Clarify which bug is CVE-2026-34743

Fixes: https://salsa.debian.org/debian/xz-utils/-/merge_requests/5#note_775071
4 weeks agoTranslations: Fix LTR/RTL issue in Arabic xz man page tables
Lasse Collin [Sun, 21 Jun 2026 16:29:59 +0000 (19:29 +0300)] 
Translations: Fix LTR/RTL issue in Arabic xz man page tables

The headings are RTL but in some tables the rows were LTR because the
first strong char was LTR, like the "e" in "-0e". Add {RLM}{LRM}...{RLM}
to those columns ("-0" to "-9", and "-0e" to "-9e"):

    sed -ri $'/^msgstr /{s/"(-[0-9]e?)"/"\u200f\u200e\\1\u200f"/}' ar.po

It's not perfect because groff doesn't treat RLM and LRM as zero-width
chars, and thus the columns are slightly misaligned. It's good enough
in practice still.

Thanks-to: Zayed Al-Saidi <zayed.alsaidi@gmail.com>
4 weeks agoCI: Add 'timeout: 10' to coverity.yml
Lasse Collin [Sun, 21 Jun 2026 17:02:49 +0000 (20:02 +0300)] 
CI: Add 'timeout: 10' to coverity.yml

4 weeks agoCI: Don't pin vmactions or MSYS2 actions to commit ID
Lasse Collin [Fri, 19 Jun 2026 19:07:15 +0000 (22:07 +0300)] 
CI: Don't pin vmactions or MSYS2 actions to commit ID

These workflows don't use any secrets other than GITHUB_TOKEN, which
only has the 'contents: read' permission. That is, if an action was
compromised, it shouldn't be able to modify the repository or steal any
secrets. I recognize that a compromised action isn't completely harmless
still. For example, the runners on GitHub have Internet access which the
action could abuse until the workflow timeout (currently 10 or 20 minutes)
expires.

Now we always use the most recent actions instead of ones that are
sometimes several months old. The hassle of updating the pinned
commit IDs goes away. The benefits feel bigger than the risks.

Link: https://github.com/tukaani-project/xz/pull/227
4 weeks agoCI: Upgrade actions/checkout from v6 to v7
Lasse Collin [Fri, 19 Jun 2026 19:07:15 +0000 (22:07 +0300)] 
CI: Upgrade actions/checkout from v6 to v7

4 weeks agoCI: Run CI workflows on push to 'ci_run' in addition to 'master'
Lasse Collin [Fri, 19 Jun 2026 19:07:15 +0000 (22:07 +0300)] 
CI: Run CI workflows on push to 'ci_run' in addition to 'master'

Make it convenient to run the CI workflows by pushing to a branch with
a specific name.

4 weeks agoCI: Remove the on 'pull_request:' entries
Lasse Collin [Fri, 19 Jun 2026 19:07:15 +0000 (22:07 +0300)] 
CI: Remove the on 'pull_request:' entries

I don't run CI from PRs, so these just add noise to the "Actions" tab
in the GH UI.

4 weeks agoCI: Use 'contents: read' after all
Lasse Collin [Fri, 19 Jun 2026 19:07:15 +0000 (22:07 +0300)] 
CI: Use 'contents: read' after all

If someone makes a private fork, then it will work there too.

Thanks-to: Eli Schwartz
5 weeks agoCI: Add 'permissions' to coverity.yml
Lasse Collin [Wed, 17 Jun 2026 13:02:45 +0000 (16:02 +0300)] 
CI: Add 'permissions' to coverity.yml

GitHub's actions/checkout@v6 is documented to need 'contents: read' but
it works without it too, probably because the repository is public.

Reported-by: GitHub user Alb3e3
Fixes: https://github.com/tukaani-project/xz/pull/230
5 weeks agoliblzma: file info decoder: Add an integer overflow check
Lasse Collin [Tue, 16 Jun 2026 18:48:57 +0000 (21:48 +0300)] 
liblzma: file info decoder: Add an integer overflow check

After the previous commit, the overflow should be impossible, but it's
better to add the check anyway.

Fixes: https://github.com/tukaani-project/xz/pull/226
5 weeks agoliblzma: Index decoder: Reject an obviously-bad Number of Records early
Lasse Collin [Tue, 2 Jun 2026 21:20:28 +0000 (00:20 +0300)] 
liblzma: Index decoder: Reject an obviously-bad Number of Records early

There no point to try decoding further when the Index is clearly not
from a valid .xz file.

This also limits what index_decoder_memconfig() can return as the
memory usage. Very huge values aren't possible anymore. This affects
file_info_decoder_memconfig() in file_info.c where very huge values
aren't expected and could result in an integer overflow when not much
memory has actually been allocated. Now the overflow can only happen if
one manages to successfully allocate and fill a few exabytes of memory.

Reported-by: GitHub user jmestwa-coder
Fixes: https://github.com/tukaani-project/xz/pull/226
5 weeks agoliblzma: Add internal constant INDEX_RECORDS_MAX
Lasse Collin [Tue, 2 Jun 2026 21:05:48 +0000 (00:05 +0300)] 
liblzma: Add internal constant INDEX_RECORDS_MAX

It's the theoretical maximum number of Records that fit in a .xz file.
This can be used to reject obviously wrong values.

5 weeks agoTranslation: Update Arabic man page translations
Lasse Collin [Wed, 17 Jun 2026 19:04:17 +0000 (22:04 +0300)] 
Translation: Update Arabic man page translations

In two tables, the column headings are now narrower and

    MANWIDTH=80 man --warnings po4a/man/ar/xz.1 > /dev/null

no longer warns.

Thanks-to: Zayed Al-Saidi <zayed.alsaidi@gmail.com>
Fixes: https://github.com/tukaani-project/xz/pull/220
5 weeks agoxzdiff: Use LC_ALL=C with sed and expr
Lasse Collin [Thu, 4 Jun 2026 20:33:37 +0000 (23:33 +0300)] 
xzdiff: Use LC_ALL=C with sed and expr

This is required to handle strings that may contain invalid multibyte
sequences. For example, on GNU/Linux and FreeBSD 14 with UTF-8 locale:

    $ printf "\201'A\n" | sed s/./x/ | hexdump -C
    00000000  81 78 41 0a                                       |.xA.|

That is, the first byte remains untouched and the ' is replaced with x.
This kind of string would result in inbalanced quotes in xzdiff. In the
C locale it works safely:

    $ printf "\201'A\n" | LC_ALL=C sed s/./x/ | hexdump -C
    00000000  78 27 41 0a                                       |x'A.|

Similar changes were made in xzgrep in 2022 (see the commits 69d1b3fc2967
and 6a4a4a7d2667). Somehow xzdiff was forgotten even though this issue
was fixed in zdiff in gzip in 2022.

Co-authored-by: rootvector2 <dxbnaveed.k@gmail.com>
Fixes: https://github.com/tukaani-project/xz/pull/228
7 weeks agoxz: Fix --files/--files0 usage via XZ_OPT and XZ_DEFAULTS env vars
rootvector2 [Thu, 28 May 2026 06:59:23 +0000 (12:29 +0530)] 
xz: Fix --files/--files0 usage via XZ_OPT and XZ_DEFAULTS env vars

If --files=FILELIST or --files0=FILELIST was specified via an enrivonment
variable, it worked if there were no errors when reading from the file
FILELIST. However, if an error occurred when reading from FILELIST,
there was a use-after-free bug when printing the error message because
the memory containing the string "FILELIST" had been freed.

    printf foo.xz > filelist.txt
    XZ_OPT=--files=filelist.txt xz -l

Because filelist.txt doesn't end in a newline, the file list is seen as
invalid/truncated, resulting in an error message like this:

    xz: ????????.txt: Unexpected end of input when reading filenames

The question marks are because the garbage string is masked using
tuklib_mask_nonprint(). After this commit, it works:

    xz: filelist.txt: Unexpected end of input when reading filenames

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Fixes: https://github.com/tukaani-project/xz/pull/223
7 weeks agoxz: Mask the multiplier suffix in str_to_uint64() error message
rootvector2 [Wed, 27 May 2026 18:21:52 +0000 (23:51 +0530)] 
xz: Mask the multiplier suffix in str_to_uint64() error message

A similar error message in the same function was masked in the
previous commit 7e7bb6c21cf9.

Fixes: https://github.com/tukaani-project/xz/pull/222
8 weeks agoxz: Use tuklib_mbstr_nonprint in a few more places
Lasse Collin [Tue, 26 May 2026 16:30:29 +0000 (19:30 +0300)] 
xz: Use tuklib_mbstr_nonprint in a few more places

Reported-by: GitHub user curious-rabbit
8 weeks agoxzgrep: Fix handling of the ' char at the end of an option
Lasse Collin [Mon, 25 May 2026 15:32:15 +0000 (18:32 +0300)] 
xzgrep: Fix handling of the ' char at the end of an option

For example, the following would run the "id" command:

    xzgrep "--a='" "--b=;id;'" "pattern" foo.xz

The bug was inherited from gzip's zgrep. It was reported to bug-gzip by
Leenear. It was fixed in gzip in the commit cd74dc30f8cc by Paul Eggert.

Link: https://lists.gnu.org/archive/html/bug-gzip/2026-04/msg00032.html
8 weeks agoUpdate THANKS
Lasse Collin [Thu, 21 May 2026 16:04:34 +0000 (19:04 +0300)] 
Update THANKS

8 weeks agoLandlock: Support ABI version 9
Lasse Collin [Thu, 21 May 2026 15:57:36 +0000 (18:57 +0300)] 
Landlock: Support ABI version 9

Features added in versions 7 and 8 shouldn't be relevant here.

8 weeks agoLandlock: Provide fallbacks for ABI 2, 3, and 5 macros
Lasse Collin [Thu, 21 May 2026 15:38:16 +0000 (18:38 +0300)] 
Landlock: Provide fallbacks for ABI 2, 3, and 5 macros

This way the newer features are available on new enough kernels
even if the package is built against old <linux/landlock.h>.

Landlock ABI versions 4 and 6 would require an extended
struct landlock_ruleset_attr. No fallback is provided (or planned)
for those features.

Suggested-by: Omkhar Arasaratnam
8 weeks agoxz: Reduce indentation of three tables on the man page
Lasse Collin [Wed, 20 May 2026 18:21:51 +0000 (21:21 +0300)] 
xz: Reduce indentation of three tables on the man page

The extra indentation makes the tables stand out from the text, and
in the English man page it works well. However, some translations
have strings that require more space, and the table might become
too wide. In some translations this has been solved by splitting
the translated string on two lines, for example, Romanian translation
of "4096-byte alignment is best".

On Debian 13 with groff 1.23.0, the "man" command shows a few warnings:

    $ LANGUAGE=it MANWIDTH=80 man --warnings xz > /dev/null
    <standard input>:477: warning: table wider than line length minus indentation
    <standard input>:545: warning: table wider than line length minus indentation
    <standard input>:1182: warning: table wider than line length minus indentation

German man page shows those warnings too. On Arch with groff 1.24.1,
there are fewer warnings because the newer groff indents less, and
fewer tables reach or exceed the right margin. Thus, some safety margin
is good to keep the output neat with different man page formatters.

It feels silly to reduce the indentation on the English man page which
has plenty of safety margin, but it's simpler than trying to do it
only for the translated man pages. This doesn't affect readability;
it's just cosmetic.

I tried using .IP instead of .RS + .PP for the tables, but on Solaris 10
it results in an extra empty line before the table. It makes some
difference on AIX 7.3 too. With groff, both are fine. Stick to
.RS + .PP + .TS ... .TE + .RE for slightly better portability.

Co-authored-by: Otto Kekäläinen <otto@debian.org>
Partially-fixes: https://github.com/tukaani-project/xz/pull/220

8 weeks agoTranslations: Fix a syntax typo in the Serbian xz man page translation
Lasse Collin [Wed, 20 May 2026 10:42:45 +0000 (13:42 +0300)] 
Translations: Fix a syntax typo in the Serbian xz man page translation

Testing with this:

    cd po4a
    ./update-po
    groff -K utf8 -man -t -ww -rCHECKSTYLE=3 -z man/sr/*.1

The output included this:

    an.tmac:man/sr/xz.1:751: style: 1 leading space(s) on input line

The actual reason seemed to be an unwanted newline (likely a typo).

8 weeks agoTranslations: Fix a groff warning in the German xz man page translation
Lasse Collin [Wed, 20 May 2026 10:37:18 +0000 (13:37 +0300)] 
Translations: Fix a groff warning in the German xz man page translation

Testing with this:

    cd po4a
    ./update-po
    groff -K utf8 -man -t -ww -rCHECKSTYLE=3 -z man/de/*.1

The output included this:

    an.tmac:man/de/xz.1:524: style: 1 leading space(s) on input line

8 weeks agoTranslations: Fix syntax in the Korean man page translations
Lasse Collin [Wed, 20 May 2026 10:32:43 +0000 (13:32 +0300)] 
Translations: Fix syntax in the Korean man page translations

Testing with this:

    cd po4a
    ./update-po
    groff -K utf8 -man -t -ww -z man/ko/*.1

It produced warnings:

    troff:man/ko/xz.1:1405: warning: color 'i' not defined
    troff:man/ko/xzdec.1:17: warning: cannot select font '\'
    troff:man/ko/xzdec.1:19: warning: cannot select font '\'

8 weeks agoTranslations: Fix a syntax typo in the French xz man page translation
Lasse Collin [Wed, 20 May 2026 10:24:03 +0000 (13:24 +0300)] 
Translations: Fix a syntax typo in the French xz man page translation

Testing with this:

    cd po4a
    ./update-po
    groff -K utf8 -man -t -ww -z man/fr/xz.1

It produced a warning:

    troff:man/fr/xz.1:516: warning: color 'i' not defined

The backslash for non-breaking space was misplaced:

    Old:  8 \\Mio,
    New:  8\\ Mio,

8 weeks agoMan pages: Improve rendering in mandoc
Lasse Collin [Wed, 20 May 2026 10:09:59 +0000 (13:09 +0300)] 
Man pages: Improve rendering in mandoc

Don't use "" as an argument to .IP because it makes mandoc insert
an unwanted extra empty line. With the xz man page, this change makes
no difference in plain text output with GNU groff or on AIX or
Solaris 10. The list in the xzgrep man page has a different indentation
now because previously it had two arguments (.IP "" 4), but that's OK.

I don't remember why '.IP' was changed to '.IP ""' in cec0ddc8ec4c.
Maybe it made a difference on some proprietary UNIX over 15 years ago
or maybe it was just a misunderstanding.

8 weeks agopo4a/update-po: Workaround an issue with non-ASCII chars in tables
Lasse Collin [Tue, 19 May 2026 22:25:41 +0000 (01:25 +0300)] 
po4a/update-po: Workaround an issue with non-ASCII chars in tables

Non-ASCII chars in tables (.TS ... .TE) result in warnings:

    man --warnings po4a/man/uk/xz.1 > /dev/null
    troff:<standard input>:464: warning: special character 'u0411\[tbl' not defined
    troff:<standard input>:1157: warning: special character 'u044\[tbl' not defined
    troff:<standard input>:1682: warning: special character 'u0434\[tbl' not defined

po4a generates groff Unicode escapes like '\u0435' followed immediately
by '[' in table contexts, causing groff to interpret the full string
'u0435[tbl' as a single special character name. Fix this by inserting
a dummy character (\&) after every Unicode escape so that the bracket
is treated as literal text instead of part of the character name.

Co-authored-by: Otto Kekäläinen <otto@debian.org>
Partially-fixes: https://github.com/tukaani-project/xz/pull/220

8 weeks agoTranslations: Update the German man page translations
Lasse Collin [Tue, 19 May 2026 15:12:07 +0000 (18:12 +0300)] 
Translations: Update the German man page translations

8 weeks agoliblzma: ARM64 & LoongArch: Avoid aligned_readXXle on unaligned pointers
Lasse Collin [Tue, 19 May 2026 14:36:15 +0000 (17:36 +0300)] 
liblzma: ARM64 & LoongArch: Avoid aligned_readXXle on unaligned pointers

While most ARM64 and LoongArch processors support unaligned access,
the code wouldn't have worked on strict-align processors.

Use byte-by-byte method if the input buffer is at most 7 bytes. This
way the code works on strict-align processors too. It might not be
the very best method for tiny buffers, but it shouldn't matter in
practice (the simple implementation for big buffers isn't amazing
either because it cannot execute more than one CRC32 instruction
at a time on superscalar processors).

Reported-by: Guanni Qu
Fixes: 0ed893668554 ("liblzma: ARM64 CRC32: Align the buffer faster")
Fixes: 7baf6835cfbf ("liblzma: Speed up CRC32 calculation on 64-bit LoongArch")
8 weeks agoliblzma: Document the lzma_stream_buffer_decode() bug
Lasse Collin [Tue, 19 May 2026 15:07:47 +0000 (18:07 +0300)] 
liblzma: Document the lzma_stream_buffer_decode() bug

8 weeks agoTests: tuktest.h: Fix a comment
Lasse Collin [Tue, 19 May 2026 11:10:03 +0000 (14:10 +0300)] 
Tests: tuktest.h: Fix a comment

8 weeks agoTests: Add a test for the lzma_stream_buffer_decode() bug
Lasse Collin [Tue, 19 May 2026 11:04:43 +0000 (14:04 +0300)] 
Tests: Add a test for the lzma_stream_buffer_decode() bug

8 weeks agoliblzma: lzma_stream_buffer_decode: Fix wrong error code
Lasse Collin [Tue, 19 May 2026 10:52:41 +0000 (13:52 +0300)] 
liblzma: lzma_stream_buffer_decode: Fix wrong error code

lzma_stream_buffer_decode() would often fail with LZMA_BUF_ERROR
when it should have failed with LZMA_DATA_ERROR.
In debug builds this also resulted in an assertion failure.

In the _buffer_decode() functions, LZMA_BUF_ERROR is only used when
the output buffer is too small. Truncated input is LZMA_DATA_ERROR.

Reported-by: Guanni Qu
Reported-by: Omkhar Arasaratnam
Fixes: c81f13ff2927 ("Added lzma_stream_buffer_decode() and made minor cleanups.")
8 weeks agoxz: Fix use-after-free in verbose error message to a non-tty
Lasse Collin [Tue, 19 May 2026 09:34:53 +0000 (12:34 +0300)] 
xz: Fix use-after-free in verbose error message to a non-tty

If --verbose was used when stderr isn't a terminal, the filename
contained a non-printable character, and an error occurred,
a use-after-free occurred when printing the error message.

The bug exists in versions 5.7.1alpha to 5.8.3.

Reported-by: Omkhar Arasaratnam
Fixes: d22f96921fd2 ("xz: Use tuklib_mbstr_nonprint")
3 months agodoc/SHA256SUMS: Add 5.8.3
Lasse Collin [Tue, 31 Mar 2026 15:41:04 +0000 (18:41 +0300)] 
doc/SHA256SUMS: Add 5.8.3

3 months agoBump version and soname for 5.8.3 v5.8.3
Lasse Collin [Tue, 31 Mar 2026 14:26:16 +0000 (17:26 +0300)] 
Bump version and soname for 5.8.3

3 months agoAdd NEWS for 5.8.3
Lasse Collin [Tue, 31 Mar 2026 14:26:16 +0000 (17:26 +0300)] 
Add NEWS for 5.8.3

3 months agoTranslations: Run "make -C po update-po"
Lasse Collin [Tue, 31 Mar 2026 14:10:47 +0000 (17:10 +0300)] 
Translations: Run "make -C po update-po"

Update the PO files to contain the comment fix from 4e76651dbaf6.

3 months agoTests: Add a test for the lzma_index_prealloc() + lzma_index_append() bug
Lasse Collin [Sun, 29 Mar 2026 17:29:40 +0000 (20:29 +0300)] 
Tests: Add a test for the lzma_index_prealloc() + lzma_index_append() bug

3 months agoliblzma: Fix a buffer overflow in lzma_index_append()
Lasse Collin [Sun, 29 Mar 2026 16:11:21 +0000 (19:11 +0300)] 
liblzma: Fix a buffer overflow in lzma_index_append()

If lzma_index_decoder() was used to decode an Index that contained no
Records, the resulting lzma_index had an invalid internal "prealloc"
value. If lzma_index_append() was called on this lzma_index, too
little memory would be allocated and a buffer overflow would occur.

While this combination of the API functions is meant to work, in the
real-world apps this call sequence is rare or might not exist at all.

This bug is older than xz 5.0.0, so all stable releases are affected.

Reported-by: GitHub user christos-spearbit
3 months agoCMake: Adjust warnings with MSVC and clang-cl
Lasse Collin [Fri, 27 Mar 2026 19:15:12 +0000 (21:15 +0200)] 
CMake: Adjust warnings with MSVC and clang-cl

When using clang-cl, avoid the long list of warning options used with
GCC and Clang because, for MSVC compatibility, clang-cl's -Wall behaves
like -Weverything.

Add warning options for MSVC. Use them with clang-cl too.

3 months agoCI: Don't disable individual warnings with clang-cl
Lasse Collin [Fri, 27 Mar 2026 19:14:50 +0000 (21:14 +0200)] 
CI: Don't disable individual warnings with clang-cl

3 months agoCI: Add Haiku
Lasse Collin [Sun, 22 Mar 2026 10:02:48 +0000 (12:02 +0200)] 
CI: Add Haiku

3 months agoUpdate THANKS
Lasse Collin [Sun, 22 Mar 2026 09:30:20 +0000 (11:30 +0200)] 
Update THANKS

3 months agoCI: Update MSYS2
Lasse Collin [Sun, 22 Mar 2026 09:29:30 +0000 (11:29 +0200)] 
CI: Update MSYS2

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Update Solaris
Lasse Collin [Sun, 22 Mar 2026 09:29:23 +0000 (11:29 +0200)] 
CI: Update Solaris

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Update OpenBSD
Lasse Collin [Sun, 22 Mar 2026 09:29:14 +0000 (11:29 +0200)] 
CI: Update OpenBSD

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Update NetBSD
Lasse Collin [Sun, 22 Mar 2026 09:29:08 +0000 (11:29 +0200)] 
CI: Update NetBSD

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Update FreeBSD
Lasse Collin [Sun, 22 Mar 2026 09:28:58 +0000 (11:28 +0200)] 
CI: Update FreeBSD

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Update DragonFly BSD
Lasse Collin [Sun, 22 Mar 2026 09:28:47 +0000 (11:28 +0200)] 
CI: Update DragonFly BSD

Closes: https://github.com/tukaani-project/xz/pull/213
3 months agoCI: Upgrade GitHub Actions for Node 24 compatibility
Salman Muin Kayser Chishti [Sat, 28 Feb 2026 09:10:46 +0000 (09:10 +0000)] 
CI: Upgrade GitHub Actions for Node 24 compatibility

Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
Closes: https://github.com/tukaani-project/xz/pull/212
3 months agoxz: Prevent an integer overflow in --files and --files0
Lasse Collin [Wed, 25 Mar 2026 17:03:00 +0000 (19:03 +0200)] 
xz: Prevent an integer overflow in --files and --files0

This requires a filename (or something that pretends to be a filename)
of at least 2 GiB on a 32-bit platform, and that realloc() to
SIZE_MAX / 2 + 1 bytes has succeeded.

Fixes: https://github.com/tukaani-project/xz/pull/218
3 months agotuklib_integer: Fix inefficient aligned_writeXXne
Lasse Collin [Mon, 23 Mar 2026 21:43:56 +0000 (23:43 +0200)] 
tuklib_integer: Fix inefficient aligned_writeXXne

The __builtin_assume_aligned was applied to the wrong argument which
made aligned writes worse on strict-align archs.

Aligned writes aren't used in liblzma, so this bug didn't matter in
this package; tuklib_integer.h is meant to be usable elsewhere too.

3 months agoBuild: Remove -Wpre-c2x-compat
Lasse Collin [Sun, 22 Mar 2026 08:22:09 +0000 (10:22 +0200)] 
Build: Remove -Wpre-c2x-compat

It makes clang -std=gnu23 noisy about bool. It's also noisy about
[[__fallthrough__]] which is only used in C23 mode.

Reported-by: Collin Funk <collin.funk1@gmail.com>
3 months agoxz: Don't fsync directories on QNX
Collin Funk [Mon, 16 Mar 2026 06:24:59 +0000 (23:24 -0700)] 
xz: Don't fsync directories on QNX

On QNX calling fsync on a directory fails with EINVAL. This causes the
following test failure:

    $ cat tests/test_suffix.sh.log
    /data/home/root/xz-5.8.2/src/xz/.libs/lt-xz: suffix_temp: Synchronizing the directory of the file failed: Invalid argument
    Failed to decompress a file with a suffix set in raw format
    FAIL test_suffix.sh (exit status: 1)

Closes: https://github.com/tukaani-project/xz/pull/216
4 months agoUpdate THANKS
Lasse Collin [Wed, 25 Feb 2026 15:33:42 +0000 (17:33 +0200)] 
Update THANKS

4 months agoliblzma: Fix a copy-paste error in commented-out code
Lasse Collin [Tue, 24 Feb 2026 22:00:49 +0000 (00:00 +0200)] 
liblzma: Fix a copy-paste error in commented-out code

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2841960994
Fixes: 96b663f67c0e ("liblzma: Refactor CRC comments.")
4 months agoFix typos and grammar in comments and docs
Lasse Collin [Tue, 24 Feb 2026 16:34:19 +0000 (18:34 +0200)] 
Fix typos and grammar in comments and docs

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2789354505
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2789354515
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2820960196
4 months agotuklib_open_stdxxx: Fix a typo in macro name
Lasse Collin [Tue, 24 Feb 2026 16:24:29 +0000 (18:24 +0200)] 
tuklib_open_stdxxx: Fix a typo in macro name

It doesn't matter in this package, but it's good to fix it still.

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313660
4 months agoCMake: Fix a wrong #define
Lasse Collin [Tue, 24 Feb 2026 16:22:25 +0000 (18:22 +0200)] 
CMake: Fix a wrong #define

HAVE_SYS_PARAM_H was misspelled HAVE_PARAM_H. This might have broken
the build on systems where sysctl() is used to detect the amount of RAM
or the number of processor cores/threads.

The cpuset code for FreeBSD doesn't need the macro it so it was removed.

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313680
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313704
Fixes: 7e3493d40eac ("Build: Add very limited experimental CMake support.")
4 months agoliblzma/MSVC: Add a cast to fix a warning (C4057) with __cpuid()
Radek Zikmund [Thu, 12 Feb 2026 14:24:15 +0000 (15:24 +0100)] 
liblzma/MSVC: Add a cast to fix a warning (C4057) with __cpuid()

__cpuid from MSVC (and also the old Intel ICC) use int[], while
__get_cpuid from <cpuid.h> in GCC and Clang use unsigned int[].
Adding a cast is the simplest fix.

Link: https://github.com/tukaani-project/xz/pull/208
4 months agoCMake: Guard script configure_file() calls with ENABLE_SCRIPTS
Radek Zikmund [Mon, 23 Feb 2026 16:50:00 +0000 (17:50 +0100)] 
CMake: Guard script configure_file() calls with ENABLE_SCRIPTS

The configure_file() calls for xzdiff, xzgrep, xzmore, and xzless
were running unconditionally within the if(UNIX) block, even when
ENABLE_SCRIPTS was OFF. This would cause a build failure if the
src/scripts/*.in files were not present. Deleting those files can
simplify license compliance when the scripts aren't needed.

Move the foreach loop and related code inside if(ENABLE_SCRIPTS) guard
so that configure_file() is only called when scripts are actually needed.
This is mostly whitespace changes to adjust the indentation.

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Closes: https://github.com/tukaani-project/xz/pull/210
5 months agoTranslations: Add Arabic man page translations
Lasse Collin [Wed, 4 Feb 2026 10:28:07 +0000 (12:28 +0200)] 
Translations: Add Arabic man page translations

Rendering of bidirectional text from man pages might not work perfectly
in all cases.

5 months agoUpdate THANKS
Lasse Collin [Sun, 25 Jan 2026 11:51:09 +0000 (13:51 +0200)] 
Update THANKS

5 months agoliblzma: Add the "License" property to liblzma.pc
Lasse Collin [Sun, 25 Jan 2026 11:30:46 +0000 (13:30 +0200)] 
liblzma: Add the "License" property to liblzma.pc

The "License" property is a pkgconf extension. See pc(5).
pkg-config 0.29.2 (2017) ignores unrecognized properties so this
commit shouldn't create compatibility issues.

pkgconf provides bomtool which uses the "License" property to generate
a software bill of materials. In pkgconf.git there is spdxtool for the
same task but with different output format.

The pkgconf extensions "Copyright" and "Maintainer" would also be
used by bomtool and spdxtool, but I don't want to add those properties
at least for now.

Co-authored-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Closes: https://github.com/tukaani-project/xz/pull/178
5 months agoUpdate THANKS
Lasse Collin [Sun, 25 Jan 2026 10:14:46 +0000 (12:14 +0200)] 
Update THANKS

5 months agoliblzma: Don't try to use x86-64 inline asm on ARM64EC
Lasse Collin [Sun, 25 Jan 2026 10:14:25 +0000 (12:14 +0200)] 
liblzma: Don't try to use x86-64 inline asm on ARM64EC

Reported-by: Chase Knowlden
Fixes: https://github.com/tukaani-project/xz/issues/206
5 months agoAutotools: Enable x86 assembler on Hurd by default
Pino Toscano [Tue, 30 Dec 2025 18:59:55 +0000 (19:59 +0100)] 
Autotools: Enable x86 assembler on Hurd by default

It has been enabled in Debian GNU/Hurd for 15+ years with no issues.
Hence, enable it by default also in the upstream sources.

The CMake build already had it enabled.

Link: https://salsa.debian.org/debian/xz-utils/-/blob/debian/5.8.2-2/debian/rules?ref_type=tags#L98
Closes: https://github.com/tukaani-project/xz/pull/204
7 months agodoc/SHA256SUMS: Add 5.8.2
Lasse Collin [Wed, 17 Dec 2025 12:49:12 +0000 (14:49 +0200)] 
doc/SHA256SUMS: Add 5.8.2

7 months agoBump version and soname for 5.8.2 v5.8.2
Lasse Collin [Wed, 17 Dec 2025 11:36:42 +0000 (13:36 +0200)] 
Bump version and soname for 5.8.2

7 months agoAdd NEWS for 5.8.2
Lasse Collin [Wed, 17 Dec 2025 11:36:35 +0000 (13:36 +0200)] 
Add NEWS for 5.8.2

7 months agoCMake: Bump maximum policy version to 4.2
Lasse Collin [Tue, 16 Dec 2025 09:30:35 +0000 (11:30 +0200)] 
CMake: Bump maximum policy version to 4.2

CMP0186 is curious but we aren't affected.

7 months agotuklib_integer/CMake: Log a message about unaligned access check
Lasse Collin [Wed, 10 Dec 2025 17:20:05 +0000 (19:20 +0200)] 
tuklib_integer/CMake: Log a message about unaligned access check

7 months agotuklib_integer/CMake: Don't run unaligned access checks unnecessarily
Lasse Collin [Wed, 10 Dec 2025 17:11:27 +0000 (19:11 +0200)] 
tuklib_integer/CMake: Don't run unaligned access checks unnecessarily

If the cache variable TUKLIB_FAST_UNALIGNED_ACCESS is already set,
the autodetection result isn't needed because the option() command
does nothing when the cache variable is already set.

This is largely white space change to indent the if...endif block.

7 months agotuklib_integer: Use CMAKE_C_COMPILER_ARCHITECTURE_ID when available
Lasse Collin [Wed, 10 Dec 2025 14:49:55 +0000 (16:49 +0200)] 
tuklib_integer: Use CMAKE_C_COMPILER_ARCHITECTURE_ID when available

CMake >= 4.1 sets CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID on many
platforms. The list of possible values are documented. Use this
variable when available. On older CMake versions CMAKE_SYSTEM_PROCESSOR
is still used, thus the regexes have to include values like ^amd64 still.

With old CMake versions, checking CMAKE_C_COMPILER_ARCHITECTURE_ID
is somewhat useful with MSVC because CMAKE_SYSTEM_PROCESSOR might
not match the target architecture.

7 months agotuklib_integer: Autodetect when -mstrict-align is used with GCC on ARM64
Lasse Collin [Wed, 10 Dec 2025 14:49:55 +0000 (16:49 +0200)] 
tuklib_integer: Autodetect when -mstrict-align is used with GCC on ARM64

On ARM64, support for fast unaligned memory access was autodetected by
checking if __ARM_FEATURE_UNALIGNED is defined. However, at least GCC
versions up to 15.2.0 define the macro even when -mstrict-align has
been specified. Thus, autodetection with GCC doesn't work correctly,
and binaries built using -mstrict-align can be much slower than they
need to be, unless the user also passes --disable-unaligned-access
to configure or -DTUKLIB_FAST_UNALIGNED_ACCESS=OFF to cmake.

See the GCC bug:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555

Workaround the issue by using heuristics with GCC on ARM64.

With Clang, the detection using __ARM_FEATURE_UNALIGNED works.
It also works with GCC on 32-bit ARM.

Fixes: e5f13a66567b ("tuklib_integer: Autodetect support for unaligned access on ARM.")
7 months agoCI: Update MSYS2
Lasse Collin [Tue, 9 Dec 2025 16:02:23 +0000 (18:02 +0200)] 
CI: Update MSYS2

7 months agoCI: Update DragonFly BSD
Lasse Collin [Tue, 9 Dec 2025 16:02:05 +0000 (18:02 +0200)] 
CI: Update DragonFly BSD

7 months agoCI: Update Solaris
Lasse Collin [Tue, 9 Dec 2025 15:58:52 +0000 (17:58 +0200)] 
CI: Update Solaris

7 months agoCI: Update NetBSD
Lasse Collin [Tue, 9 Dec 2025 15:56:58 +0000 (17:56 +0200)] 
CI: Update NetBSD

7 months agoCI: Update OpenBSD
Lasse Collin [Tue, 9 Dec 2025 15:54:54 +0000 (17:54 +0200)] 
CI: Update OpenBSD

7 months agoCI: Update FreeBSD
Lasse Collin [Tue, 9 Dec 2025 15:52:01 +0000 (17:52 +0200)] 
CI: Update FreeBSD