mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #39498 from Avogar/fix-avro
Fix data race and possible heap-buffer-overflow in Avro format
This commit is contained in:
commit
c78fe0fc10
2
contrib/avro
vendored
2
contrib/avro
vendored
@ -1 +1 @@
|
||||
Subproject commit e43c46e87fd32eafdc09471e95344555454c5ef8
|
||||
Subproject commit 7832659ec986075d560f930c288e973c64679552
|
25
tests/queries/0_stateless/02372_data_race_in_avro.sh
Executable file
25
tests/queries/0_stateless/02372_data_race_in_avro.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
for i in $(seq 1 10);
|
||||
do
|
||||
$CLICKHOUSE_CLIENT -q "drop table if exists t_avro_$i"
|
||||
$CLICKHOUSE_CLIENT -q "create table t_avro_$i (x UInt32, s String) engine=File(Avro)"
|
||||
done
|
||||
|
||||
for i in $(seq 1 10);
|
||||
do
|
||||
$CLICKHOUSE_CLIENT -q "insert into t_avro_$i select number, 'str' from numbers(1000) settings engine_file_truncate_on_insert=1" > /dev/null &
|
||||
done
|
||||
|
||||
sleep 5
|
||||
|
||||
for i in $(seq 1 10);
|
||||
do
|
||||
$CLICKHOUSE_CLIENT-q "drop table t_avro_$i"
|
||||
done
|
||||
|
@ -0,0 +1 @@
|
||||
OK
|
13
tests/queries/0_stateless/02373_heap_buffer_overflow_in_avro.sh
Executable file
13
tests/queries/0_stateless/02373_heap_buffer_overflow_in_avro.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$(clickhouse-client --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
cp $CURDIR/data_avro/corrupted.avro $USER_FILES_PATH/
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "select * from file(corrupted.avro)" 2>&1 | grep -F -q "Cannot read compressed data" && echo "OK" || echo "FAIL"
|
||||
|
BIN
tests/queries/0_stateless/data_avro/corrupted.avro
Normal file
BIN
tests/queries/0_stateless/data_avro/corrupted.avro
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user