Browse Source

[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
master
Glenn Strauss 7 months ago
parent
commit
fb7e5a7832
  1. 5
      src/ls-hpack/lshpack.c

5
src/ls-hpack/lshpack.c

@ -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;

Loading…
Cancel
Save