[sr-dev] git:master:071556e9: log_custom: use buffer size for printing functions

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 22 18:47:40 CEST 2016


Module: kamailio
Branch: master
Commit: 071556e9b75557dad756951f2fad71504469ca32
URL: https://github.com/kamailio/kamailio/commit/071556e9b75557dad756951f2fad71504469ca32

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-06-22T18:34:40+02:00

log_custom: use buffer size for printing functions

---

Modified: modules/log_custom/log_custom_mod.c

---

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

---

diff --git a/modules/log_custom/log_custom_mod.c b/modules/log_custom/log_custom_mod.c
index b66ec10..bc68b56 100644
--- a/modules/log_custom/log_custom_mod.c
+++ b/modules/log_custom/log_custom_mod.c
@@ -189,8 +189,8 @@ void _lc_core_log_udp(int lpriority, const char *format, ...)
 	va_start(arglist, format);
 
 	n = 0;
-	n += snprintf(obuf+n, 1024-n, "(%d) ", my_pid());
-	n += vsnprintf(obuf+n, 1024-n, format, arglist);
+	n += snprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, "(%d) ", my_pid());
+	n += vsnprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, format, arglist);
 	va_end(arglist);
 	udp_send(&_lc_udp_dst, obuf, n);
 }




More information about the sr-dev mailing list