aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_ident.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-08-11 14:20:18 +0100
committerGravatar Sadie Powell2022-08-11 15:40:57 +0100
commitf88fbaa2fe91c22f1c7280ecd96c2bcf92f73a4d (patch)
treee35803070a6ca8e50ee2d07b2e6c0d71230d53f3 /src/modules/m_ident.cpp
parentClean up the sockaddrs documentation comments. (diff)
Move aptosa/untosa into the sockaddrs union and add from/from_ip.
The struct will also now always be zero-initialized by default which removes the footgun which has happened previously where the union has been accessed before being initialized leading to it containing weird values.
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r--src/modules/m_ident.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 6866af3d4..17b5c4c24 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -120,11 +120,8 @@ public:
done = false;
- irc::sockets::sockaddrs bindaddr;
- irc::sockets::sockaddrs connaddr;
-
- memcpy(&bindaddr, &user->server_sa, sizeof(bindaddr));
- memcpy(&connaddr, &user->client_sa, sizeof(connaddr));
+ irc::sockets::sockaddrs bindaddr(user->server_sa);
+ irc::sockets::sockaddrs connaddr(user->client_sa);
if (connaddr.family() == AF_INET6)
{