aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-11-09 15:54:43 +0100
committerHarald Welte <laforge@gnumonks.org>2018-11-22 14:12:18 +0000
commit5371a212937ad5eca33699bad3be8c101ab10cee (patch)
tree60af99d2fb0eb98c820dc5c50b9c32f2c299c6a8
parentc3824bca16e27051b455b4532a04b21e3ee8d2b4 (diff)
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
-rw-r--r--src/osmo_ss7.c3
1 files changed, 2 insertions, 1 deletions
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 @@ static unsigned int get_pc_comp_shift(const struct osmo_ss7_pc_fmt *pc_fmt,
case 2:
return 0;
default:
- return -EINVAL;
+ /* Invalid number of components */
+ OSMO_ASSERT(false);
}
}