diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-11-07 06:22:11 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-11-07 06:22:11 +0000 |
| commit | d259e194df12569c8fe286eacd285be28118ecd7 (patch) | |
| tree | 838258e9a13837f135e94257e7d17db9c9218608 /backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch | |
| parent | b1143670a63c1a72a4bd0e0e4337fc5fa3be85b4 (diff) | |
automatic import of zlibopeneuler24.03_LTS_SP3
Diffstat (limited to 'backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch')
| -rw-r--r-- | backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch b/backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch new file mode 100644 index 0000000..449a9e3 --- /dev/null +++ b/backport-Suppress-MSAN-detections-in-deflate-slide_hash.patch @@ -0,0 +1,36 @@ +From 981ee7570ad98a3cf1ae74d737e2ee619ed79171 Mon Sep 17 00:00:00 2001 +From: Andrzej Hunt <andrzej@ahunt.org> +Date: Fri, 4 Jun 2021 18:25:19 +0200 +Subject: [PATCH] Suppress MSAN detections in deflate's slide_hash(). + +slide_hash() knowingly reads potentially uninitialized memory, see +comment lower down about prev[n] potentially being garbage. In +this case, the result is never used. + +Reference:https://github.com/madler/zlib/commit/981ee7570ad98a3cf1ae74d737e2ee619ed79171 +Conflict:NA +--- + deflate.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/deflate.c b/deflate.c +index 5410497..8088083 100644 +--- a/deflate.c ++++ b/deflate.c +@@ -209,6 +209,13 @@ local const config configuration_table[10] = { + * bit values at the expense of memory usage). We slide even when level == 0 to + * keep the hash table consistent if we switch back to level > 0 later. + */ ++ ++#if defined(__has_feature) ++# if __has_feature(memory_sanitizer) ++ __attribute__((no_sanitize("memory"))) ++# endif ++#endif ++ + local void slide_hash(s) + deflate_state *s; + { +-- +2.27.0 + |
