aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-05-24 19:13:38 -0400
committerTom Tsou <tom.tsou@ettus.com>2015-06-01 16:04:10 -0700
commit2966048b07188e1562b805a19cd0108d837c7abb (patch)
treee3fa170227be02f12e8ee0a538d9390306051be7 /Transceiver52M/Transceiver.cpp
parentf5fd578d6097c295192840e846a8e4eca5cef5d2 (diff)
transceiver: Fix out-of-bounds acces in genRandNormalBurst().
We should read gTrainingSequence starting from 0 bit index, not 61 bit index. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index d54f52d..66a2e21 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -87,8 +87,8 @@ static BitVector *genRandNormalBurst(size_t tsc)
(*bits)[i] = rand() % 2;
/* Training sequence */
- for (; i < 87; i++)
- (*bits)[i] = GSM::gTrainingSequence[tsc][i];
+ for (int j = 0; i < 87; i++, j++)
+ (*bits)[i] = GSM::gTrainingSequence[tsc][j];
/* Random bits */
for (; i < 144; i++)