Browse code

snmpstats: use snprintf instead of snprintf

Daniel-Constantin Mierla authored on 28/11/2019 19:08:24
Showing 1 changed files
... ...
@@ -420,7 +420,7 @@ int kamailioSIPContactTable_get_value(netsnmp_request_info *request,
420 420
 
421 421
 			/* Convert the float into a string, as specified by the
422 422
 			 * MIB. */
423
-			sprintf(contactPreference, "%5.2f", preferenceAsFloat);
423
+			snprintf(contactPreference, 6, "%5.2f", preferenceAsFloat);
424 424
 
425 425
 			snmp_set_var_typed_value(
426 426
 					var, ASN_OCTET_STR, (unsigned char *)contactPreference, 5);
... ...
@@ -443,4 +443,4 @@ const kamailioSIPContactTable_context *kamailioSIPContactTable_get_by_idx(
443 443
 {
444 444
 	return (const kamailioSIPContactTable_context *)CONTAINER_FIND(
445 445
 			cb.container, hdr);
446
-}
447 446
\ No newline at end of file
447
+}