xz/src/liblzma
Lasse Collin 7510721767
liblzma: Always validate the first digit of a preset string
lzma_str_to_filters() may call parse_lzma12_preset() in two ways. The
call from str_to_filters() detects the string type from the first
character(s) and as a side-effect it validates the first digit of
the preset string. So this change makes no difference there.

However, the call from parse_options() doesn't pre-validate the string.
parse_lzma12_preset() will return an invalid value which is passed to
lzma_lzma_preset() which safely rejects it. The bug still affects the
the error message:

    $ xz --filters=lzma2:preset=X
    xz: Error in --filters=FILTERS option:
    xz: lzma2:preset=X
    xz:               ^
    xz: Unsupported preset

After the fix:

    $ xz --filters=lzma2:preset=X
    xz: Error in --filters=FILTERS option:
    xz: lzma2:preset=X
    xz:              ^
    xz: Unsupported preset

The ^ now correctly points to the X and not past it because the X itself
is the problematic character.

Fixes: cedeeca2ea
2025-01-05 12:58:22 +02:00
..
api liblzma: Fix incorrect macro name in a comment 2024-12-18 17:09:29 +02:00
check Update AUTHORS 2025-01-04 19:57:17 +02:00
common liblzma: Always validate the first digit of a preset string 2025-01-05 12:58:22 +02:00
delta liblzma: Minor comment edits. 2024-03-15 18:03:47 +02:00
lz liblzma: Move lzma_crcXX_table[][] declarations to crc_common.h 2024-06-23 15:37:46 +03:00
lzma liblzma: Silence warnings from "clang -Wimplicit-fallthrough" 2025-01-02 15:43:38 +02:00
rangecoder liblzma: Fix x86-64 movzw compatibility in range_decoder.h 2024-08-22 10:59:08 +03:00
simple liblzma: Optimize the loop conditions in BCJ filters 2024-11-26 19:17:42 +02:00
Makefile.am Build: Set libtool -version-info so that it matches with CMake 2024-12-29 10:54:45 +02:00
liblzma.pc.in Add SPDX license identifier into 0BSD source code files. 2024-02-14 18:31:16 +02:00
liblzma_generic.map Bump version and soname for 5.7.0alpha. 2024-02-24 16:30:06 +08:00
liblzma_linux.map Bump version and soname for 5.7.0alpha. 2024-02-24 16:30:06 +08:00
liblzma_w32res.rc Windows: Set DLL name accurately in StringFileInfo on Cygwin and MSYS2 2024-09-30 16:55:23 +03:00
validate_map.sh liblzma: Fix validate_map.sh. 2024-02-14 19:46:11 +02:00