ensure cdict is properly reset to NULL

This commit is contained in:
Yann Collet
2025-02-05 18:42:00 -08:00
parent 7406d2b6eb
commit f11bd19c7f
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -67,11 +67,11 @@ jobs:
- name: thread sanitizer zstreamtest - name: thread sanitizer zstreamtest
run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream
ubsan-zstreamtest: uasan-zstreamtest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1 - 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 run: CC=clang make uasan-test-zstream
# lasts ~15mn # lasts ~15mn
+1
View File
@@ -1323,6 +1323,7 @@ size_t ZSTDMT_initCStream_internal(
/* update dictionary */ /* update dictionary */
ZSTD_freeCDict(mtctx->cdictLocal); ZSTD_freeCDict(mtctx->cdictLocal);
mtctx->cdictLocal = NULL; mtctx->cdictLocal = NULL;
mtctx->cdict = NULL;
if (dict) { if (dict) {
if (dictContentType == ZSTD_dct_rawContent) { if (dictContentType == ZSTD_dct_rawContent) {
mtctx->inBuff.prefix.start = (const BYTE*)dict; mtctx->inBuff.prefix.start = (const BYTE*)dict;