Change in osmo-pcu[master]: csn1: verify enough bits present to decode whole CSN_UINT_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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Mar 30 10:08:04 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/17631 )

Change subject: csn1: verify enough bits present to decode whole CSN_UINT_ARRAY
......................................................................

csn1: verify enough bits present to decode whole CSN_UINT_ARRAY

Change-Id: I4a762a8fec4153b53e10df1ec8ba3708c1f47649
---
M src/csn1.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, approved
  osmith: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/csn1.c b/src/csn1.c
index 1b3cc55..78444bb 100644
--- a/src/csn1.c
+++ b/src/csn1.c
@@ -338,7 +338,7 @@
           nCount = *pui16DATA(data, nCount);
         }
 
-        if (remaining_bits_len >= no_of_bits)
+        if (remaining_bits_len >= (no_of_bits * nCount))
         {
           remaining_bits_len -= (no_of_bits*nCount);
           if (no_of_bits <= 8)
@@ -781,7 +781,7 @@
               nCount = *pui16DATA(data, nCount);
             }
 
-            if (remaining_bits_len >= no_of_bits)
+            if (remaining_bits_len >= (no_of_bits * nCount))
             {
               remaining_bits_len -= (no_of_bits * nCount);
               if (no_of_bits <= 8)
@@ -1650,7 +1650,7 @@
           nCount = *pui16DATA(data, nCount);
         }
 
-        if (remaining_bits_len >= no_of_bits)
+        if (remaining_bits_len >= (no_of_bits * nCount))
         {
           if (no_of_bits <= 8)
           {
@@ -2067,7 +2067,7 @@
               nCount = *pui16DATA(data, nCount);
             }
 
-            if (remaining_bits_len >= no_of_bits)
+            if (remaining_bits_len >= (no_of_bits * nCount))
             {
               if (no_of_bits <= 8)
               {

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I4a762a8fec4153b53e10df1ec8ba3708c1f47649
Gerrit-Change-Number: 17631
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200330/b8b9f890/attachment.htm>


More information about the gerrit-log mailing list