Module: kamailio
Branch: master
Commit: b40349dbbf73a4c0f90706f86b79d7b9ff3dbb44
URL:
https://github.com/kamailio/kamailio/commit/b40349dbbf73a4c0f90706f86b79d7b…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2017-02-02T08:24:58+01:00
ims_qos: Safety check on length of ports
---
Modified: src/modules/ims_qos/rx_avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b40349dbbf73a4c0f90706f86b79d7b…
Patch:
https://github.com/kamailio/kamailio/commit/b40349dbbf73a4c0f90706f86b79d7b…
---
diff --git a/src/modules/ims_qos/rx_avp.c b/src/modules/ims_qos/rx_avp.c
index fcf529e..2e0a851 100644
--- a/src/modules/ims_qos/rx_avp.c
+++ b/src/modules/ims_qos/rx_avp.c
@@ -784,11 +784,11 @@ AAA_AVP *rx_create_media_subcomponent_avp(int number, str* proto,
if (int_port_rctp_b % 2 == 0) {
int_port_rctp_b ++;
}
- char c_port_rtcp_a[5];
- port_rtcp_a.len = sprintf(c_port_rtcp_a, "%d", int_port_rctp_a);
+ char c_port_rtcp_a[10];
+ port_rtcp_a.len = snprintf(c_port_rtcp_a, 10, "%d", int_port_rctp_a);
port_rtcp_a.s = c_port_rtcp_a;
- char c_port_rtcp_b[5];
- port_rtcp_b.len = sprintf(c_port_rtcp_b, "%d", int_port_rctp_b);
+ char c_port_rtcp_b[10];
+ port_rtcp_b.len = snprintf(c_port_rtcp_b, 10, "%d", int_port_rctp_b);
port_rtcp_b.s = c_port_rtcp_b;
LM_DBG("RTCP A Port [%.*s] RCTP B Port [%.*s]\n", port_rtcp_a.len,
port_rtcp_a.s, port_rtcp_b.len, port_rtcp_b.s);