Fix null pointer dereference in low cardinality data#33021
Fix null pointer dereference in low cardinality data#33021evillique merged 1 commit intoClickHouse:masterfrom
Conversation
|
Please, merge this pr with master. |
Backport #33021 to 21.3: Fix null pointer dereference in low cardinality data
Backport #33021 to 21.12: Fix null pointer dereference in low cardinality data
|
We have a stack trace which looks like the one below. Does this fix address the following stack trace? I see the following in the stack trace which leads me to believe that this PR might fix it
|
Backport #33021 to 21.8: Fix null pointer dereference in low cardinality data
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category:
Changelog entry:
Fix null pointer dereference in low cardinality data when deserializing LowCardinality data in the Native format.
Detailed description / Documentation draft:
When deserializing LowCardinality data in the Native format it is possible for an attacker to cause ClickHouse to crash with a null pointer dereference.
In original code, if the flag index_type.has_additional_keys is false(which can be set to false in binary file or when sending data through native protocol by an attacker) and the code is expecting additional keys to be used in normal cases, the null pointer dereferencing happens since the false flag will cause addtional_keys to be nullptr by following code:
The fix is to add code to check if it is nullptr before the usage and throw exceptions if it is the case.