vcl/workben/fodt2pdffuzzer.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 9d8a223b3550326d89f80124287acc071853405c Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jan 21 21:02:09 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jan 21 22:04:50 2024 +0100 Try harder to clear Use-of-uninitialized-value from LLVMFuzzerCustomMutator Try the workaround of https://github.com/google/oss-fuzz/issues/4605 Change-Id: If02072f244b05e005c0c180ce689f7a919105ec4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162353 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/workben/fodt2pdffuzzer.cxx b/vcl/workben/fodt2pdffuzzer.cxx index 0b6323a61ad8..91e04966c1ff 100644 --- a/vcl/workben/fodt2pdffuzzer.cxx +++ b/vcl/workben/fodt2pdffuzzer.cxx @@ -57,11 +57,17 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) extern "C" size_t LLVMFuzzerMutate(uint8_t* Data, size_t Size, size_t MaxSize); +extern "C" { +__attribute__((weak)) void __msan_unpoison(const volatile void*, size_t) {} +} + extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* Data, size_t Size, size_t MaxSize, unsigned int /*Seed*/) { size_t Ret = LLVMFuzzerMutate(Data, Size, MaxSize); + __msan_unpoison(Data, Ret); + // an effort to only generate valid xml, in this fuzzer we only really care // about the deeper levels of turning valid input into writer layout and // pdf export