Skip to content

Commit

Permalink
Array size fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptokatz committed Apr 30, 2021
1 parent 8452dc3 commit a1eac2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Serialization/BinaryInputStreamSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void BinaryInputStreamSerializer::endObject() {
bool BinaryInputStreamSerializer::beginArray(size_t& size, Common::StringView name) {
readVarintAs<uint64_t>(stream, size);

if (size > 100 * 1024 * 1024) {
if (size > 10000 * 1024 * 1024) {
throw std::runtime_error("array size is too big");
}

Expand Down Expand Up @@ -93,7 +93,7 @@ bool BinaryInputStreamSerializer::operator()(std::string& value, Common::StringV
uint64_t size;
readVarint(stream, size);

if (size > 100 * 1024 * 1024) {
if (size > 10000 * 1024 * 1024) {
throw std::runtime_error("string size is too big");
} else if (size > 0) {
std::vector<char> temp;
Expand Down
2 changes: 1 addition & 1 deletion src/Serialization/KVBinaryInputStreamSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ size_t readVarint(Common::IInputStream& s) {

std::string readString(Common::IInputStream& s) {
auto size = readVarint(s);
if (size > 100 * 1024 * 1024) {
if (size > 10000 * 1024 * 1024) {
throw std::runtime_error("string size is too big");
}

Expand Down

0 comments on commit a1eac2c

Please sign in to comment.