diff options
| author | robot-piglet <[email protected]> | 2024-01-31 17:59:10 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-01-31 18:43:19 +0300 |
| commit | 812e7e202ea3ff85db090a5c171e542a24f73c88 (patch) | |
| tree | 2d27e71700f179093129d1470b3b081083ef44ec /library/cpp/netliba/v6/udp_address.cpp | |
| parent | 9cde6ebc1cd157b794b58775da2b284b6a3871ae (diff) | |
Intermediate changes
Diffstat (limited to 'library/cpp/netliba/v6/udp_address.cpp')
| -rw-r--r-- | library/cpp/netliba/v6/udp_address.cpp | 6 |
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 17540602e9c..ba5fd6f45b1 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); |
