From 56ad5cd26c082cf97043c7e39a49e243d78efb41 Mon Sep 17 00:00:00 2001 From: George Tokmaji Date: Tue, 19 Nov 2024 09:14:39 +0100 Subject: [PATCH] C4NetIO::GetLocalAddresses: Fix off-by-one error in buffer size --- src/C4NetIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/C4NetIO.cpp b/src/C4NetIO.cpp index 612926aad..b581446ff 100644 --- a/src/C4NetIO.cpp +++ b/src/C4NetIO.cpp @@ -326,7 +326,7 @@ std::vector C4NetIO::GetLocalAddresses(bool unsorted) sa6.sin6_family = AF_INET6; const auto a6 = sa6.sin6_addr.s6_addr; std::uint8_t if_idx, plen, scope, flags; - char devname[20]; + char devname[20 + 1]; while (std::fscanf(f.f, "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx " "%02" SCNx8 " %02" SCNx8 " %02" SCNx8 " %02" SCNx8 " %20s\n",