1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-838 Enforce copy of string in StringStore

Since we aren't using C++11 the deserialize was doing using reference
counts for string copy which occasionally caused a use after free.
This commit is contained in:
Andrew Hutchings
2017-07-31 06:38:21 +01:00
parent 470082df81
commit cc1cbaa160

View File

@ -144,7 +144,7 @@ uint32_t StringStore::deserialize(ByteStream &bs)
for (i = 0; i < count; i++) {
//cout << "deserializing " << size << " bytes\n";
bs >> buf;
shared_ptr<std::string> newString(new std::string(buf));
shared_ptr<std::string> newString(new std::string(buf.c_str()));
mem.push_back(newString);
//bs.advance(size);
ret += (size + 4);