[PATCH] libosmo-sccp[master]: osmo_sccp_addr_encode(): Fix truncation of point codes

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Oct 27 13:00:02 UTC 2017


Review at  https://gerrit.osmocom.org/4445

osmo_sccp_addr_encode(): Fix truncation of point codes

In osmo_sccp_addr_encode(), we accidentially truncated all point
codes to 10 bits, where in reality we should have truncated them to
14 bits: One 'f' was missing in the bit-mask.

Closes: OS#2441
Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8
---
M src/sccp2sua.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/45/4445/1

diff --git a/src/sccp2sua.c b/src/sccp2sua.c
index e435d9f..ac2b2c2 100644
--- a/src/sccp2sua.c
+++ b/src/sccp2sua.c
@@ -245,7 +245,7 @@
 			LOGP(DLSUA, LOGL_ERROR, "Invalid Point Code %u requested\n", in->pc);
 			return -EINVAL;
 		}
-		msgb_put_u16le(msg, in->pc & 0x3ff);
+		msgb_put_u16le(msg, in->pc & 0x3fff);
 	}
 
 	if (in->presence & OSMO_SCCP_ADDR_T_SSN) {

-- 
To view, visit https://gerrit.osmocom.org/4445
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>


More information about the gerrit-log mailing list