From fc39ce8673b5af8c6bf6a1e6c2f0756d033e62c7 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 26 Dec 2018 07:12:14 +0300 Subject: [PATCH] Fixed UB #3926 --- dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h b/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h index 094cae05615..c6fb68c86dd 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h @@ -121,8 +121,11 @@ public: offsets_to.push_back(offsets_to.back() + size); - typename ColumnVector::Container & data_to = static_cast &>(arr_to.getData()).getData(); - data_to.insert(this->data(place).value.begin(), this->data(place).value.end()); + if (size) + { + typename ColumnVector::Container & data_to = static_cast &>(arr_to.getData()).getData(); + data_to.insert(this->data(place).value.begin(), this->data(place).value.end()); + } } bool allocatesMemoryInArena() const override