[sr-dev] git:master:05bd956a: cnxcc: use snprintf() instead of sprintf()

Daniel-Constantin Mierla miconda at gmail.com
Mon Nov 18 18:34:17 CET 2019


Module: kamailio
Branch: master
Commit: 05bd956a9980ffc8938cdbce6bab3af5086350dd
URL: https://github.com/kamailio/kamailio/commit/05bd956a9980ffc8938cdbce6bab3af5086350dd

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-11-18T18:29:05+01:00

cnxcc: use snprintf() instead of sprintf()

---

Modified: src/modules/cnxcc/cnxcc_sip_msg_faker.c

---

Diff:  https://github.com/kamailio/kamailio/commit/05bd956a9980ffc8938cdbce6bab3af5086350dd.diff
Patch: https://github.com/kamailio/kamailio/commit/05bd956a9980ffc8938cdbce6bab3af5086350dd.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