Skip to content

Fix possible buffer overflow in ConsoleChannel#102118

Open
peter15914 wants to merge 1 commit intoClickHouse:masterfrom
peter15914:fix-consolechannel-buffer-overflow
Open

Fix possible buffer overflow in ConsoleChannel#102118
peter15914 wants to merge 1 commit intoClickHouse:masterfrom
peter15914:fix-consolechannel-buffer-overflow

Conversation

@peter15914
Copy link
Copy Markdown

Enum Message::PRIO_TEST has value of 9 and is used as array index for _colors in ColorConsoleChannel::setProperty(). Therefore length of _colors array should be increased to 10.

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixes possible buffer overflow that could occur while using ColorConsoleChannel.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Enum ```Message::PRIO_TEST``` has value of 9 and is used as array index for ```_colors``` in ColorConsoleChannel::setProperty().
Therefore length of ```_colors``` array should be increased to 10.
@peter15914 peter15914 marked this pull request as ready for review April 8, 2026 18:02
@alexey-milovidov
Copy link
Copy Markdown
Member

  1. How can we ensure it is checked at compile time?
  2. Can you write a test for this issue? It can run clickhouse-local under expect with send_logs_level = test, so it will catch the problem under MSan.

@alexey-milovidov alexey-milovidov self-assigned this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants