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


Change subject: fix pcu_rx(): actually discard malformed container message
......................................................................

fix pcu_rx(): actually discard malformed container message

Currently we do log an error, but then still call pcu_rx_container(),
passing it a malformed message.  The function does have an additional
length check inside, but let's better discard it early.

Change-Id: I8410ecf35442ab75741a5c9cd29d640ce5508e57
Related: OS#5963
---
M src/pcu_l1_if.cpp
1 file changed, 16 insertions(+), 0 deletions(-)



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

diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index bbeb3aa..577ba57 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -1285,6 +1285,8 @@
                if (pcu_prim_length < exp_len) {
                        LOGP(DL1IF, LOGL_ERROR, "Received %zu bytes on PCU 
Socket, but primitive container size" \
                             "is %zu, discarding\n", pcu_prim_length, exp_len);
+                       rc = -EINVAL;
+                       break;
                }
                rc = pcu_rx_container(bts, &pcu_prim->u.container);
                break;

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I8410ecf35442ab75741a5c9cd29d640ce5508e57
Gerrit-Change-Number: 32072
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to