Module: kamailio
Branch: master
Commit: 071556e9b75557dad756951f2fad71504469ca32
URL:
https://github.com/kamailio/kamailio/commit/071556e9b75557dad756951f2fad715…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/071556e9b75557dad756951f2fad715…
Patch:
https://github.com/kamailio/kamailio/commit/071556e9b75557dad756951f2fad715…
---
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);
}