Merge pull request #60359 from Avogar/fix-ipv6-hashing

Fix use-of-uninitialized-value and invalid result in hashing functions with IPv6
This commit is contained in:
Ilya Yatsishin 2024-02-28 15:32:57 +04:00 committed by GitHub
commit 6473023ad5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 1 deletions

View File

@ -279,7 +279,7 @@ public:
for (size_t i = 0; i < size; ++i)
{
Impl::apply(
reinterpret_cast<const char *>(&data[i * length]), length, reinterpret_cast<uint8_t *>(&chars_to[i * Impl::length]));
reinterpret_cast<const char *>(&data[i]), length, reinterpret_cast<uint8_t *>(&chars_to[i * Impl::length]));
}
return col_to;
}

View File

@ -0,0 +1,20 @@
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö¢ÞãTñ£K{êaƒ—;xdP

View File

@ -0,0 +1,5 @@
-- Tags: no-fasttest
SELECT toIPv6(materialize(toLowCardinality('fe80::62:5aff:fed1:daf0'))) AS ipv6, SHA256(ipv6) from numbers(10);
SELECT toIPv6(materialize('fe80::62:5aff:fed1:daf0')) AS ipv6, SHA256(ipv6) from numbers(10);