[sr-dev] git:5.3:daecf049: cnxcc: use snprintf() instead of sprintf()

Victor Seva linuxmaniac at torreviejawireless.org
Fri Jun 5 14:22:22 CEST 2020


Module: kamailio
Branch: 5.3
Commit: daecf0490c144a6f3fd5c66c53a86f33b6295681
URL: https://github.com/kamailio/kamailio/commit/daecf0490c144a6f3fd5c66c53a86f33b6295681

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2020-06-05T14:17:17+02:00

cnxcc: use snprintf() instead of sprintf()

(cherry picked from commit 05bd956a9980ffc8938cdbce6bab3af5086350dd)

---

Modified: src/modules/cnxcc/cnxcc_sip_msg_faker.c

---

Diff:  https://github.com/kamailio/kamailio/commit/daecf0490c144a6f3fd5c66c53a86f33b6295681.diff
Patch: https://github.com/kamailio/kamailio/commit/daecf0490c144a6f3fd5c66c53a86f33b6295681.patch

---

diff --git a/src/modules/cnxcc/cnxcc_sip_msg_faker.c b/src/modules/cnxcc/cnxcc_sip_msg_faker.c
index 7b601d537a..dbb8694f6a 100644
--- a/src/modules/cnxcc/cnxcc_sip_msg_faker.c
+++ b/src/modules/cnxcc/cnxcc_sip_msg_faker.c
@@ -40,7 +40,7 @@ int faked_msg_init_with_dlg_info(str *callid, str *from_uri, str *from_tag,
 {
 	memset(_faked_sip_msg_buf, 0, FAKED_SIP_MSG_BUF_LEN);
 
-	sprintf(_faked_sip_msg_buf, FAKED_SIP_MSG_FORMAT, from_uri->len,
+	snprintf(_faked_sip_msg_buf, FAKED_SIP_MSG_BUF_LEN, FAKED_SIP_MSG_FORMAT, from_uri->len,
 			from_uri->s, from_tag->len, from_tag->s, to_uri->len, to_uri->s,
 			to_tag->len, to_tag->s, callid->len, callid->s);
 




More information about the sr-dev mailing list