0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-23 20:38:20 +02:00

ircd::rfc1035: Fix possible #AC from unaligned uint128_t.

This commit is contained in:
Jason Volk 2020-04-24 20:18:58 -07:00
parent 6bbc78116d
commit 71a0ec7532

View file

@ -264,7 +264,14 @@ ircd::rfc1035::record::AAAA::AAAA(const answer &answer)
"AAAA record data underflow"
};
ip6 = ntoh(*reinterpret_cast<const uint128_t *>(data(rdata)));
uint128_t ip6;
#if __has_builtin(__builtin_memcpy_inline)
__builtin_memcpy_inline(&ip6, data(rdata), sizeof(ip6));
#else
__builtin_memcpy(&ip6, data(rdata), sizeof(ip6));
#endif
this->ip6 = ntoh(ip6);
}
void