csn1: fix existNextElement(): use bitvec_get_bit_pos()

As was discovered recently (see OS#4388), bitvec_read_field()
would never return a negative value because its return type
is unsigned (uint64_t).

We don't really need to get more than one bit, so let's just
use the bitvec_get_bit_pos() instead.

Change-Id: I763a295cd955cd33f542292c85d97ff82f6b49bc
Related: OS#4388
This commit is contained in:
Vadim Yanitskiy 2020-02-16 23:36:38 +07:00
parent fa5f91c05f
commit 74bc150ab2
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ static gint16 ProcessError_impl(const char *file, int line, unsigned readIndex,
static gboolean
existNextElement(bitvec *vector, unsigned& readIndex, guint8 Tag)
{
guint8 res = bitvec_read_field(vector, &readIndex, 1);
int res = bitvec_get_bit_pos(vector, readIndex++);
if (Tag == STANDARD_TAG)
{
return (res > 0);