Skip to content

Commit 9d8b99d

Browse files
authored
Merge pull request #60 from amondonedo/master
Updated LZ4 version 1.9.2
2 parents d070906 + 86fddbb commit 9d8b99d

File tree

7 files changed

+3942
-1580
lines changed

7 files changed

+3942
-1580
lines changed

clickhouse/base/compressed.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool CompressedInput::Decompress() {
8585

8686
data_ = Buffer(original);
8787

88-
if (LZ4_decompress_fast((const char*)tmp.data() + 9, (char*)data_.data(), original) < 0) {
88+
if (LZ4_decompress_safe((const char*)tmp.data() + 9, (char*)data_.data(), compressed - 9, original) < 0) {
8989
throw std::runtime_error("can't decompress data");
9090
} else {
9191
mem_.Reset(data_.data(), original);

clickhouse/client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void Client::Impl::SendData(const Block& block) {
671671
buf.resize(9 + LZ4_compressBound(tmp.size()));
672672

673673
// Compress data
674-
int size = LZ4_compress((const char*)tmp.data(), (char*)buf.data() + 9, tmp.size());
674+
int size = LZ4_compress_default((const char*)tmp.data(), (char*)buf.data() + 9, tmp.size(), buf.size() - 9);
675675
buf.resize(9 + size);
676676

677677
// Fill header

contrib/lz4/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LZ4 Library
2-
Copyright (c) 2011-2014, Yann Collet
2+
Copyright (c) 2011-2016, Yann Collet
33
All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without modification,

0 commit comments

Comments
 (0)