[sr-dev] git:master:913ba6f1: pv_headers: use snprintf instead of sprintf

Victor Seva linuxmaniac at torreviejawireless.org
Mon Dec 9 09:15:32 CET 2019


Module: kamailio
Branch: master
Commit: 913ba6f196d19005a0e93ad0dbbdc48f532a9897
URL: https://github.com/kamailio/kamailio/commit/913ba6f196d19005a0e93ad0dbbdc48f532a9897

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2019-12-09T09:12:05+01:00

pv_headers: use snprintf instead of sprintf

---

Modified: src/modules/pv_headers/pvh_xavp.c

---

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

---

diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index de296b4bca..fa7fe1b9e1 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -384,7 +384,7 @@ int pvh_get_branch_xname(struct sip_msg *msg, str *xname, str *dst)
 
 	pvh_get_branch_index(msg, &br_idx);
 	if(br_idx > 0) {
-		sprintf(br_idx_s, "%d", br_idx - 1);
+		snprintf(br_idx_s, 32, "%d", br_idx - 1);
 		br_idx_len = strlen(br_idx_s);
 		memcpy(dst->s + os, ".", 1);
 		os += 1;




More information about the sr-dev mailing list