Module: kamailio
Branch: master
Commit: 7943395957c070a16553b16536e5be59b4719d9b
URL:
https://github.com/kamailio/kamailio/commit/7943395957c070a16553b16536e5be5…
Author: Dragos Vingarzan <vingarzan(a)gmail.com>
Committer: Dragos Vingarzan <vingarzan(a)gmail.com>
Date: 2024-07-25T11:47:24+02:00
ims_qos_npn: fixed missing breaks in switch and checks for null pointers
---
Modified: src/modules/ims_qos_npn/rx_aar.c
Modified: src/modules/ims_qos_npn/rx_avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7943395957c070a16553b16536e5be5…
Patch:
https://github.com/kamailio/kamailio/commit/7943395957c070a16553b16536e5be5…
---
diff --git a/src/modules/ims_qos_npn/rx_aar.c b/src/modules/ims_qos_npn/rx_aar.c
index fc99344c2c6..4423a0561b2 100644
--- a/src/modules/ims_qos_npn/rx_aar.c
+++ b/src/modules/ims_qos_npn/rx_aar.c
@@ -615,7 +615,7 @@ int add_media_components(AAAMessage *aar, struct sip_msg *req,
//check if the src or dst port is 0 and if so then don't add to rx
intportA = atoi(req_sdp_stream->port.s);
- if(rpl) {
+ if(rpl_sdp_stream) {
intportB = atoi(rpl_sdp_stream->port.s);
}
if(intportA != 0 && (rpl && intportB != 0)) {
@@ -719,18 +719,20 @@ int add_media_components(AAAMessage *aar, struct sip_msg *req,
auth->u.auth.generic_data,
sdp_stream_num + 1, &req_sdp_stream->media,
&ipA, &portA, &ipB, &portB,
- rpl ? &rpl_sdp_stream->transport : 0,
+ rpl_sdp_stream ? &rpl_sdp_stream->transport : 0,
&req_sdp_stream->raw_stream,
- rpl ? &rpl_sdp_stream->raw_stream : 0,
+ rpl_sdp_stream ? &rpl_sdp_stream->raw_stream
+ : 0,
direction,
0 /*This is a new mcd, we are not setting it as active*/);
rx_add_media_component_description_avp(aar,
sdp_stream_num + 1, &req_sdp_stream->media,
&ipA, &portA, &ipB, &portB,
- rpl ? &rpl_sdp_stream->transport : 0,
+ rpl_sdp_stream ? &rpl_sdp_stream->transport : 0,
&req_sdp_stream->raw_stream,
- rpl ? &rpl_sdp_stream->raw_stream : 0,
+ rpl_sdp_stream ? &rpl_sdp_stream->raw_stream
+ : 0,
direction, AVP_EPC_Flow_Usage_No_Information);
}
add_flow = 1;
diff --git a/src/modules/ims_qos_npn/rx_avp.c b/src/modules/ims_qos_npn/rx_avp.c
index a0053138b4f..a2fd3188efe 100644
--- a/src/modules/ims_qos_npn/rx_avp.c
+++ b/src/modules/ims_qos_npn/rx_avp.c
@@ -1402,7 +1402,7 @@ int rx_mcc_mnc_to_sip_visited(str *dst, str src)
}
mcc = (100 * (src.s[0] - '0') + (10 * (src.s[1] - '0'))
+ ((src.s[2] - '0')));
- if(mcc < 0 || mcc >= 999) {
+ if(mcc >= 999) {
LOG(L_ERR, "Invalid MCC value\n");
return 0;
}
@@ -1699,6 +1699,7 @@ int rx_avp_process_3gpp_user_location_information(AAAMessage *rar,
str *dst)
p += 7;
length -= 7;
}
+ break;
case 1:
// SAI
if(length >= 7) {
@@ -1707,6 +1708,7 @@ int rx_avp_process_3gpp_user_location_information(AAAMessage *rar,
str *dst)
p += 7;
length -= 7;
}
+ break;
case 2:
// RAI
if(length >= 7) {
@@ -1715,6 +1717,7 @@ int rx_avp_process_3gpp_user_location_information(AAAMessage *rar,
str *dst)
p += 7;
length -= 7;
}
+ break;
case 3 ... 127:
// spare for future use
break;