[core] silence coverity warnings in ls-hpack

The code originates from https://github.com/litespeedtech/ls-hpack
and is explicitly documented as not needing to be initialized.

x-ref:
  634c69215f
  d92883ca10
This commit is contained in:
Glenn Strauss 2020-10-20 15:51:46 -04:00
parent af04e0b0e1
commit fb7e5a7832
1 changed files with 4 additions and 1 deletions

View File

@ -699,7 +699,7 @@ lshpack_enc_huff_encode (const unsigned char *src,
uintptr_t bits; /* OK not to initialize this variable */
unsigned bits_used = 0, adj;
struct encode_el cur_enc_code;
#if __GNUC__
#if __GNUC__ && !defined(__COVERITY__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wuninitialized"
@ -762,6 +762,9 @@ lshpack_enc_huff_encode (const unsigned char *src,
}
else if (p_dst + sizeof(bits) <= dst_end)
{
#ifdef __COVERITY__
assert(bits_used);
#endif
bits <<= sizeof(bits) * 8 - bits_used;
bits_used = cur_enc_code.bits - (sizeof(bits) * 8 - bits_used);
bits |= cur_enc_code.code >> bits_used;