未验证 提交 40a99b74 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #21492 from azat/client-fix-highlight-multiline-comment

Fix heap-buffer-overflow in highlighting multi-line comments
......@@ -275,7 +275,8 @@ Token Lexer::nextTokenImpl()
else
++pos;
}
return Token(TokenType::ErrorMultilineCommentIsNotClosed, token_begin, end);
pos = end;
return Token(TokenType::ErrorMultilineCommentIsNotClosed, token_begin, pos);
}
}
return Token(TokenType::Slash, token_begin, pos);
......
#!/usr/bin/expect -f
log_user 0
set timeout 5
match_max 100000
# A default timeout action is to do nothing, change it to fail
expect_after {
timeout {
exit 2
}
}
set basedir [file dirname $argv0]
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT"
expect ":) "
# regression for heap-buffer-overflow issue (under ASAN)
send -- "/**"
expect "/**"
# just in case few more bytes
send -- "foobar"
expect "/**foobar"
send -- "\3\4"
expect eof
......@@ -212,6 +212,7 @@
01017_uniqCombined_memory_usage
01747_join_view_filter_dictionary
01748_dictionary_table_dot
01755_client_highlight_multi_line_comment_regression
00950_dict_get
01683_flat_dictionary
01681_cache_dictionary_simple_key
......
......@@ -95,7 +95,8 @@
"01370_client_autocomplete_word_break_characters",
"01676_clickhouse_client_autocomplete",
"01193_metadata_loading",
"01455_time_zones"
"01455_time_zones",
"01755_client_highlight_multi_line_comment_regression"
],
"release-build": [
],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册