mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Disable implicit conversion from char* -> ipv4 -> ipv6
This is a footgun with some massive bullets.
This commit is contained in:
parent
8a07131229
commit
b93d8ef875
Notes:
github-actions[bot]
2024-11-20 20:44:49 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/b93d8ef8757 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2111 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 9 additions and 0 deletions
|
@ -29,6 +29,15 @@ public:
|
||||||
m_data[i] = data[i];
|
m_data[i] = data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr IPv6Address(Array<u8, 16> const& data)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < 16; i++)
|
||||||
|
m_data[i] = data[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
template<SameAs<char const*> T>
|
||||||
|
constexpr IPv6Address(T const&) = delete; // Disable implicit conversion of char const* -> ipv4 -> ipv6
|
||||||
|
|
||||||
constexpr IPv6Address(IPv4Address const& ipv4_address)
|
constexpr IPv6Address(IPv4Address const& ipv4_address)
|
||||||
{
|
{
|
||||||
// IPv4 mapped IPv6 address
|
// IPv4 mapped IPv6 address
|
||||||
|
|
Loading…
Reference in a new issue