pespin submitted this change.

View Change

Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified
xua_snm: Fix mask_from_affected_pc() always returning 0

A recent commit adding the mask_from_affected_pc() mistyped the aff_pc
converting it to a uint8_t, which is wrong. Fix it.

Related: Coverity CID#563282
Related: OS#7078
Fixes: 41af6a55110d6ddc5febce71d5bba3cf0f33f27e
Change-Id: Id376528802662b8ea53845158e73a1f730e6c590
---
M src/xua_snm.c
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xua_snm.c b/src/xua_snm.c
index 3aa067e..609cd95 100644
--- a/src/xua_snm.c
+++ b/src/xua_snm.c
@@ -53,7 +53,7 @@
* This prevents creating incorrect bitmasks and ending up in long loops based on peer
* inputting unexpected big values (ie. >14 on ITU and >24 on ANSI).
*/
-static uint8_t mask_from_affected_pc(const struct osmo_ss7_instance *s7i, uint8_t aff_pc)
+static uint8_t mask_from_affected_pc(const struct osmo_ss7_instance *s7i, uint32_t aff_pc)
{
const uint8_t pc_width = osmo_ss7_pc_width(&s7i->cfg.pc_fmt);
uint8_t mask = aff_pc >> 24;

To view, visit change 43442. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Id376528802662b8ea53845158e73a1f730e6c590
Gerrit-Change-Number: 43442
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>