osmo-pcu/tests/rlcmac
Neels Hofmeyr 0241526836 Fix CSN1 decoding: CSN_LEFT_ALIGNED_VAR_BMP bounds
Fix attempted read past vector boundaries in case of a starting bit offset !=
0, so that the last amount of bits read should be < 8. In the case of
CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation was flawed, and in the final
step, 8 bits were read instead of the remainder < 8. This lead to -EINVAL being
returned by bitvec_get_bit_pos() and bogus resulting data.

Instead, read 8 bits only as long as at least 8 bits remain, and read any
remaining bits < 8 in a final step. Drop unneeded nB1 variable and an obvious
comment.

Adjust the unit test assertion in testCsnLeftAlignedVarBmpBounds() in
RLCMACTest.cpp.

Based on a fix by Aravind Sirsikar <Arvind.Sirsikar@radisys.com>, but
implemented differently.

Related: OS#1805
Change-Id: I490498c8da6b531f54acb673379379f7b10907c0
2016-09-14 01:26:34 +00:00
..
RLCMACTest.cpp Fix CSN1 decoding: CSN_LEFT_ALIGNED_VAR_BMP bounds 2016-09-14 01:26:34 +00:00
RLCMACTest.err tests: Move the RLCMACTest into the test directory and setup autotest 2013-08-02 13:40:20 +04:00
RLCMACTest.ok Fix issue in encoding CSN_RECURSIVE_ARRAY 2016-03-16 15:01:53 +01:00