From f11bd19c7f7899840585a260688e969eb705a008 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sat, 1 Feb 2025 00:55:52 -0800 Subject: [PATCH] ensure cdict is properly reset to NULL --- .github/workflows/dev-long-tests.yml | 4 ++-- lib/compress/zstdmt_compress.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-long-tests.yml b/.github/workflows/dev-long-tests.yml index 0adfed914..899a57b75 100644 --- a/.github/workflows/dev-long-tests.yml +++ b/.github/workflows/dev-long-tests.yml @@ -67,11 +67,11 @@ jobs: - name: thread sanitizer zstreamtest run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream - ubsan-zstreamtest: + uasan-zstreamtest: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1 - - name: undefined behavior sanitizer zstreamtest + - name: ub + address sanitizer on zstreamtest run: CC=clang make uasan-test-zstream # lasts ~15mn diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 210ff63fa..1840ad855 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -1323,6 +1323,7 @@ size_t ZSTDMT_initCStream_internal( /* update dictionary */ ZSTD_freeCDict(mtctx->cdictLocal); mtctx->cdictLocal = NULL; + mtctx->cdict = NULL; if (dict) { if (dictContentType == ZSTD_dct_rawContent) { mtctx->inBuff.prefix.start = (const BYTE*)dict; -- 2.47.2