path: root/CommonLibs
diff options
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-03-08 07:13:15 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-03-08 07:13:15 +0000
commit7645fcaa5d0fd478c05a349cb117cc526049e2c6 (patch)
treeabee29482ba3820c09a6171d413ca476cd2da503 /CommonLibs
parent3b5c0c1e91db9d6ef4d19a4879c8c7953fb67054 (diff)
Harvind found a bug in BitVector.cpp:
Basically the unpack method and fillField method assume MSB-first bit packing. The unpack method calls fillField for each byte that needs to be unpacked. The problem occurs on its final call to fillField when it has a partial byte to unpack; it uses the LSB bits instead of the MSB bits. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3288 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'CommonLibs')
1 files changed, 1 insertions, 1 deletions
diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index 1d13dec..54a3edc 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -564,7 +564,7 @@ void BitVector::unpack(const unsigned char* src)
unsigned whole = bytes*8;
unsigned rem = size() - whole;
if (rem==0) return;
- fillField(whole,src[bytes],rem);
+ fillField(whole,src[bytes] >> (8-rem),rem);
void BitVector::hex(ostream& os) const