aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Leach <mike.leach@linaro.org>2022-10-24 23:06:03 +0100
committerMike Leach <mike.leach@linaro.org>2022-10-27 16:34:36 +0100
commitb35fc0ea6285018878ea382254c1e6a4b516669a (patch)
tree1a510649464064ef8d971a25f7611f8ab0693394
parent8c3a95cc3fae14c2c1b26401b3494b0e49dfdb95 (diff)
opencsd: ptm: Fix bug in extraction of waypoint update address. (github issue #48)
Indexing the address bytes misses the last byte of 4 continuation bytes resulting in incorrect decode. This patch fixes the indexing. Reported-by vimalraj-rajasekharan (github issue #48) Signed-off-by: Mike Leach <mike.leach@linaro.org>
-rw-r--r--decoder/source/ptm/trc_pkt_proc_ptm.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/decoder/source/ptm/trc_pkt_proc_ptm.cpp b/decoder/source/ptm/trc_pkt_proc_ptm.cpp
index a7419b0a6ea5..668a14b73df0 100644
--- a/decoder/source/ptm/trc_pkt_proc_ptm.cpp
+++ b/decoder/source/ptm/trc_pkt_proc_ptm.cpp
@@ -560,7 +560,7 @@ void TrcPktProcPtm::pktWPointUpdate()
m_gotExcepBytes = false; // mark as not got all required exception bytes thus far
m_numExcepBytes = 0; // 0 read in
- m_addrPktIsa = ocsd_isa_unknown; // not set by this packet as yet
+ m_addrPktIsa = ocsd_isa_unknown; // not set by this packet as yet
}
// collect all the bytes needed
@@ -568,10 +568,12 @@ void TrcPktProcPtm::pktWPointUpdate()
{
if(readByte(currByte))
{
+
byteIdx = m_currPacketData.size() - 1;
if(!m_gotAddrBytes)
{
- if(byteIdx < 4)
+ // byteIdx for address byte will run from 1 to 5 - first 4 my have continuation or not.
+ if(byteIdx <= 4)
{
// address bytes 1 - 4;
// ISA stays the same