This is an automated email from the ASF dual-hosted git repository.
jvanderzee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 2adc60f98b Suppress CID 1523641 (#11664)
2adc60f98b is described below
commit 2adc60f98bf49553c41245b260cf0a1cb44aae65
Author: JosiahWI <[email protected]>
AuthorDate: Tue Aug 13 12:02:19 2024 -0500
Suppress CID 1523641 (#11664)
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 26d4245c5d..6898a36fa9 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<uint8_t, 4096> local_buffer(value_len * 4);
uint8_t *data = local_buffer.data();