1
0
mirror of https://git.tukaani.org/xz.git synced 2025-02-22 16:38:11 +00:00
xz/src/liblzma
Lasse Collin bfe9be7a46 liblzma: Fix incorrect function type error from sanitizer
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)
2024-05-23 00:13:43 +03:00
..
2024-05-22 14:07:37 +03:00
2024-05-22 14:32:36 +03:00
2024-03-09 11:42:50 +08:00
2024-02-14 19:46:11 +02:00