From 47eaed7fcc160e87b27badf4ef8efef04faf8ec6 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sat, 18 Jul 2026 16:42:28 +0200 Subject: [PATCH] fix(compress): reject by-reference dictionaries in Rust fast path Include localDict.dict in the eligibility guard for the simple Rust compress2 route. By-reference dictionary loads populate this field without populating dictBuffer, so omitting it incorrectly allowed a dictionary-bearing context to bypass the C dictionary path. Test Plan: - ./tests/fuzzer -s9634 -v - git diff --check --- lib/compress/zstd_compress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 65c233646..69382709d 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -3942,6 +3942,7 @@ int ZSTD_rust_simpleCompress2Level(const void* opaqueCctx, size_t srcSize) || cctx->seqCollector.collectSequences != 0 || cctx->cdict != NULL || cctx->prefixDict.dict != NULL + || cctx->localDict.dict != NULL || cctx->localDict.dictBuffer != NULL || cctx->localDict.cdict != NULL) { return (-2147483647 - 1);