From b93d8ef8757af1655294ad960defaf73f4ba78cf Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 1 Nov 2024 23:49:54 +0100 Subject: [PATCH] AK: Disable implicit conversion from char* -> ipv4 -> ipv6 This is a footgun with some massive bullets. --- AK/IPv6Address.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index 995bdd0add5..dd64d9f58a8 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -29,6 +29,15 @@ public: m_data[i] = data[i]; } + constexpr IPv6Address(Array const& data) + { + for (size_t i = 0; i < 16; i++) + m_data[i] = data[i]; + } + + template T> + constexpr IPv6Address(T const&) = delete; // Disable implicit conversion of char const* -> ipv4 -> ipv6 + constexpr IPv6Address(IPv4Address const& ipv4_address) { // IPv4 mapped IPv6 address