From e00779ef1b5a7155f3bd053b4b7d0e91fe00f67d Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Sat, 10 Aug 2024 07:48:21 -0500 Subject: [PATCH] Suppress CID 1523641 The variable `use_huffman` is used to decide which branch to take, but is hardcoded to `true`. This has already been suppressed for cppcheck, and Coverity says we can suppress it by declaring the variable with `const`. I think `constexpr` should also work, but I couldn't confirm this. --- src/proxy/hdrs/XPACK.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proxy/hdrs/XPACK.cc b/src/proxy/hdrs/XPACK.cc index 26d4245c5d2..6898a36fa9f 100644 --- a/src/proxy/hdrs/XPACK.cc +++ b/src/proxy/hdrs/XPACK.cc @@ -179,8 +179,8 @@ xpack_encode_integer(uint8_t *buf_start, const uint8_t *buf_end, uint64_t value, int64_t xpack_encode_string(uint8_t *buf_start, const uint8_t *buf_end, const char *value, uint64_t value_len, uint8_t n) { - uint8_t *p = buf_start; - bool use_huffman = true; + uint8_t *p = buf_start; + constexpr bool use_huffman = true; ts::LocalBuffer local_buffer(value_len * 4); uint8_t *data = local_buffer.data();