Change in osmo-pcu[master]: csn1: Fix readIndex pointer change in CSN_VARIABLE_ARRAY

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Nov 23 17:02:05 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/21305 )


Change subject: csn1: Fix readIndex pointer change in CSN_VARIABLE_ARRAY
......................................................................

csn1: Fix readIndex pointer change in CSN_VARIABLE_ARRAY

There's actually 3 errors:
* Its value should be updated, not the pointer itself
* Value should be increased, not decreased
* bitvec_read_field() API is already advancing it, no need to do it

Fixes: OS#4838
Change-Id: I009abc373794e148091e637ffee80c6461960945
---
M src/csn1.c
M tests/rlcmac/RLCMACTest.cpp
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/21305/1

diff --git a/src/csn1.c b/src/csn1.c
index fa29e27..c66f598 100644
--- a/src/csn1.c
+++ b/src/csn1.c
@@ -1216,9 +1216,8 @@
 
           while (count > 0)
           {
-            readIndex -= 8;
 	    *pui8 = bitvec_read_field(vector, readIndex, 8);
-            LOGPC(DCSN1, LOGL_DEBUG, "%s = %u | ", pDescr->sz , (unsigned)*pui8);
+            LOGPC(DCSN1, LOGL_DEBUG, "%s = 0x%x | ", pDescr->sz , (unsigned)*pui8);
             pui8++;
             bit_offset += 8;
             count--;
diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp
index f1b6508..44b05cc 100644
--- a/tests/rlcmac/RLCMACTest.cpp
+++ b/tests/rlcmac/RLCMACTest.cpp
@@ -110,6 +110,7 @@
 	"4913e00850884013a8048b2b2b2b2b2b2b2b2b2b2b2b2b", // Polling Request (malformed)
 	"412430007fffffffffffffffefd19c7ba12b2b2b2b2b2b", // Packet Uplink Ack Nack?
 	"41942b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // System Info 13?
+	"40883c1493120000000012000000000000000000000000", // Pkt Paging Request (OS#4838)
 	};
 
 	int testDataSize = sizeof(testData)/sizeof(testData[0]);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/21305
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I009abc373794e148091e637ffee80c6461960945
Gerrit-Change-Number: 21305
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201123/925fe3e7/attachment.htm>


More information about the gerrit-log mailing list