mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Fix MSan report in AES functions
This commit is contained in:
parent
4e11e7cfa9
commit
56d09886e2
@ -303,6 +303,10 @@ private:
|
|||||||
if constexpr (!std::is_same_v<std::nullptr_t, std::decay_t<IvColumnType>>)
|
if constexpr (!std::is_same_v<std::nullptr_t, std::decay_t<IvColumnType>>)
|
||||||
{
|
{
|
||||||
iv_value = iv_column->getDataAt(r);
|
iv_value = iv_column->getDataAt(r);
|
||||||
|
|
||||||
|
/// If the length is zero (empty string is passed) it should be treat as no IV.
|
||||||
|
if (iv_value.size == 0)
|
||||||
|
iv_value.data = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto input_value = input_column->getDataAt(r);
|
const auto input_value = input_column->getDataAt(r);
|
||||||
@ -571,6 +575,10 @@ private:
|
|||||||
if constexpr (!std::is_same_v<std::nullptr_t, std::decay_t<IvColumnType>>)
|
if constexpr (!std::is_same_v<std::nullptr_t, std::decay_t<IvColumnType>>)
|
||||||
{
|
{
|
||||||
iv_value = iv_column->getDataAt(r);
|
iv_value = iv_column->getDataAt(r);
|
||||||
|
|
||||||
|
/// If the length is zero (empty string is passed) it should be treat as no IV.
|
||||||
|
if (iv_value.size == 0)
|
||||||
|
iv_value.data = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto input_value = input_column->getDataAt(r);
|
auto input_value = input_column->getDataAt(r);
|
||||||
|
2
tests/queries/0_stateless/01663_aes_msan.reference
Normal file
2
tests/queries/0_stateless/01663_aes_msan.reference
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
4DB2B0F12DE073FD063CE5478903DE68
|
||||||
|
text
|
2
tests/queries/0_stateless/01663_aes_msan.sql
Normal file
2
tests/queries/0_stateless/01663_aes_msan.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
SELECT hex(encrypt('aes-128-cbc', 'text', 'keykeykeykeykeyk', ''));
|
||||||
|
SELECT decrypt('aes-128-cbc', encrypt('aes-128-cbc', 'text', 'keykeykeykeykeyk', ''), 'keykeykeykeykeyk', '');
|
Loading…
Reference in New Issue
Block a user