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

Max gerrit-no-reply at lists.osmocom.org
Fri Nov 9 15:03:34 UTC 2018


Max has uploaded this change for review. ( 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 unsinged 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(-)



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

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 9805b3b..c493672 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: newchange
Gerrit-Change-Id: Ib24cdbcf614bad68f3cfa9776a451c5c1e45ae6e
Gerrit-Change-Number: 11707
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181109/725b9a92/attachment.htm>


More information about the gerrit-log mailing list