Module: kamailio
Branch: master
Commit: f268aa2f53f550eec45e5030a08f6d586941913e
URL:
https://github.com/kamailio/kamailio/commit/f268aa2f53f550eec45e5030a08f6d5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-28T20:08:58+01:00
snmpstats: use snprintf instead of snprintf
---
Modified: src/modules/snmpstats/snmpSIPContactTable.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f268aa2f53f550eec45e5030a08f6d5…
Patch:
https://github.com/kamailio/kamailio/commit/f268aa2f53f550eec45e5030a08f6d5…
---
diff --git a/src/modules/snmpstats/snmpSIPContactTable.c
b/src/modules/snmpstats/snmpSIPContactTable.c
index 77f497dce3..d23f8557ac 100644
--- a/src/modules/snmpstats/snmpSIPContactTable.c
+++ b/src/modules/snmpstats/snmpSIPContactTable.c
@@ -420,7 +420,7 @@ int kamailioSIPContactTable_get_value(netsnmp_request_info *request,
/* Convert the float into a string, as specified by the
* MIB. */
- sprintf(contactPreference, "%5.2f", preferenceAsFloat);
+ snprintf(contactPreference, 6, "%5.2f", preferenceAsFloat);
snmp_set_var_typed_value(
var, ASN_OCTET_STR, (unsigned char *)contactPreference, 5);
@@ -443,4 +443,4 @@ const kamailioSIPContactTable_context
*kamailioSIPContactTable_get_by_idx(
{
return (const kamailioSIPContactTable_context *)CONTAINER_FIND(
cb.container, hdr);
-}
\ No newline at end of file
+}