csn1: Fix an infinite loop in CSN.1 dissector when having more than 255 padding bits

Port of wireshark.git 8b5aa913711b32b1e1bc707919d2a98c1875d443.

Ported-by: Pau Espin Pedrol <pespin@sysmocom.de>
Change-Id: I7f6aecc2c0f300c1a77cd683652969d3f1aa5794
This commit is contained in:
Pascal Quantin 2020-01-24 17:33:06 +01:00 committed by Pau Espin Pedrol
parent 5b71697618
commit c515551625
2 changed files with 2 additions and 1 deletions

View File

@ -1150,7 +1150,7 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
{
while (remaining_bits_len > 0)
{
guint8 bits_to_handle = remaining_bits_len%8;
guint bits_to_handle = remaining_bits_len%8;
if (bits_to_handle > 0)
{
LOGPC(DCSN1, LOGL_NOTICE, "%" PRIu64 "|", bitvec_read_field(vector, &readIndex, bits_to_handle));

View File

@ -56,6 +56,7 @@ extern "C" {
typedef signed int gint32;
typedef signed short gint16;
typedef int gint;
typedef unsigned int guint;
typedef gint gboolean;
typedef unsigned char guint8;
typedef unsigned short guint16;