Browse code

ims_qos: Safety check on length of ports

Carsten Bock authored on 02/02/2017 07:22:05
Showing 1 changed files
... ...
@@ -1004,14 +1004,14 @@ int rx_send_aar_register(struct sip_msg *msg, AAASession* auth, saved_transactio
1004 1004
     raw_stream.s = 0;
1005 1005
     raw_stream.len = 0;
1006 1006
 
1007
-    char c_port_from[5];
1007
+    char c_port_from[10];
1008 1008
     str port_from;
1009
-    port_from.len = sprintf(c_port_from, "%u", saved_t_data->via_port);
1009
+    port_from.len = snprintf(c_port_from, 10, "%u", saved_t_data->via_port);
1010 1010
     port_from.s = c_port_from;
1011 1011
 
1012
-    char c_port_to[5];
1012
+    char c_port_to[10];
1013 1013
     str port_to;
1014
-    port_to.len = sprintf(c_port_to, "%u", saved_t_data->recv_port);
1014
+    port_to.len = snprintf(c_port_to, 10, "%u", saved_t_data->recv_port);
1015 1015
     port_to.s = c_port_to;
1016 1016
 
1017 1017
     str protocol;