CSN.1: Fix compiler warning showing wrong copy

Let's do what's done for u8, which looks far more sane.

Fixes following gcc 11.2.0 warning:
"""
epan/dissectors/packet-csn1.c:913:17: warning: ‘ui16’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  913 |                 memcpy(pui16, &ui16, 2);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
"""
This commit is contained in:
Pau Espin 2022-02-21 13:54:58 +01:00 committed by A Wireshark GitLab Utility
parent f5277d0186
commit a059280b5d
1 changed files with 2 additions and 2 deletions

View File

@ -900,17 +900,17 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
}
else if (no_of_bits <= 16)
{
guint16 ui16;
pui16 = pui16DATA(data, pDescr->offset);
while (nCount > 0)
{
guint16 ui16;
ui16 = tvb_get_bits16(tvb, bit_offset, no_of_bits, ENC_BIG_ENDIAN);
proto_tree_add_uint_bits_format_value(tree, *(pDescr->hf_ptr), tvb, bit_offset, no_of_bits, ui16, ENC_BIG_ENDIAN, " (Count %d)", i++);
memcpy(pui16++, &ui16, sizeof(ui16));
bit_offset += no_of_bits;
nCount--;
}
memcpy(pui16, &ui16, 2);
}
else if (no_of_bits <= 32)
{ /* not supported */