Change in libosmo-sccp[master]: SS7: safeguard against wrong number of pointcode component

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Nov 22 14:12:18 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11707 )

Change subject: SS7: safeguard against wrong number of pointcode component
......................................................................

SS7: safeguard against wrong number of pointcode component

Previously internal function get_pc_comp_shift() returned negative error
code when called with wrong component number despite unsigned return
value which wasn't checked for error anyway.

Fix this by using explicit assert in the error path. This should not
affect external users because this function always called with constant
component argument.

Change-Id: Ib24cdbcf614bad68f3cfa9776a451c5c1e45ae6e
---
M src/osmo_ss7.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 6fb8180..39d92fa 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -198,7 +198,8 @@
 	case 2:
 		return 0;
 	default:
-		return -EINVAL;
+		/* Invalid number of components */
+		OSMO_ASSERT(false);
 	}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/11707
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib24cdbcf614bad68f3cfa9776a451c5c1e45ae6e
Gerrit-Change-Number: 11707
Gerrit-PatchSet: 3
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181122/d62ea9bc/attachment.htm>


More information about the gerrit-log mailing list