Skip to content

Commit

Permalink
C4NetIO::GetLocalAddresses: Fix off-by-one error in buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgen301 committed Nov 19, 2024
1 parent f86cb6a commit 56ad5cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/C4NetIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ std::vector<C4Network2HostAddress> 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",
Expand Down

0 comments on commit 56ad5cd

Please sign in to comment.