aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/netliba/v6/udp_address.cpp
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-01-31 17:59:10 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-02-09 19:16:40 +0300
commitc88ff01faaf3dbc93564a15e930bb533a56516d1 (patch)
tree6172c63a181460fbcd40a7fbea97f3ed8f41bd39 /library/cpp/netliba/v6/udp_address.cpp
parent22faf7825187091e0ac85a196aab658c151f83be (diff)
downloadydb-c88ff01faaf3dbc93564a15e930bb533a56516d1.tar.gz
Intermediate changes
Diffstat (limited to 'library/cpp/netliba/v6/udp_address.cpp')
-rw-r--r--library/cpp/netliba/v6/udp_address.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/cpp/netliba/v6/udp_address.cpp b/library/cpp/netliba/v6/udp_address.cpp
index 17540602e9..ba5fd6f45b 100644
--- a/library/cpp/netliba/v6/udp_address.cpp
+++ b/library/cpp/netliba/v6/udp_address.cpp
@@ -278,7 +278,7 @@ namespace NNetliba {
char buf[1000];
if (addr.IsIPv4()) {
int ip = addr.GetIPv4();
- sprintf(buf, "%d.%d.%d.%d:%d",
+ snprintf(buf, sizeof(buf), "%d.%d.%d.%d:%d",
(ip >> 0) & 0xff, (ip >> 8) & 0xff,
(ip >> 16) & 0xff, (ip >> 24) & 0xff,
addr.Port);
@@ -288,9 +288,9 @@ namespace NNetliba {
*BreakAliasing<ui64>(ipv6 + 4) = addr.Interface;
char suffix[100] = "";
if (addr.Scope != 0) {
- sprintf(suffix, "%%%d", addr.Scope);
+ snprintf(suffix, sizeof(suffix), "%%%d", addr.Scope);
}
- sprintf(buf, "[%x:%x:%x:%x:%x:%x:%x:%x%s]:%d",
+ snprintf(buf, sizeof(buf), "[%x:%x:%x:%x:%x:%x:%x:%x%s]:%d",
ntohs(ipv6[0]), ntohs(ipv6[1]), ntohs(ipv6[2]), ntohs(ipv6[3]),
ntohs(ipv6[4]), ntohs(ipv6[5]), ntohs(ipv6[6]), ntohs(ipv6[7]),
suffix, addr.Port);