Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lz4 from upstream #4232

Merged
merged 7 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ librdkafka v2.0.3 is a bugfix release:
* Fix seek partition timeout, was one thousand times lower than the passed
value (#4230).
* Batch consumer fixes: TODO: describe (#4208).
* Update lz4.c from upstream. Fixes [CVE-2021-3520](https://github.com/advisories/GHSA-gmc7-pqv9-966m)
(by @filimonov, #4232).
* Upgrade OpenSSL to v3.0.8 with various security fixes,
check the [release notes](https://www.openssl.org/news/cl30.txt) (#4215).

Expand Down
8 changes: 4 additions & 4 deletions src/lz4.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
LZ4 - Fast LZ compression algorithm
Copyright (C) 2011-present, Yann Collet.
Copyright (C) 2011-2020, Yann Collet.

BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)

Expand Down Expand Up @@ -1051,7 +1051,7 @@ LZ4_FORCE_INLINE int LZ4_compress_generic_validated(
_next_match:
/* at this stage, the following variables must be correctly set :
* - ip : at start of LZ operation
* - match : at start of previous pattern occurence; can be within current prefix, or within extDict
* - match : at start of previous pattern occurrence; can be within current prefix, or within extDict
* - offset : if maybe_ext_memSegment==1 (constant)
* - lowLimit : must be == dictionary to mean "match is within extDict"; must be == source otherwise
* - token and *token : position to write 4-bits for match length; higher 4-bits for literal length supposed already written
Expand Down Expand Up @@ -1752,7 +1752,7 @@ LZ4_decompress_generic(
const size_t dictSize /* note : = 0 if noDict */
)
{
if (src == NULL) { return -1; }
if ((src == NULL) || (outputSize < 0)) { return -1; }

{ const BYTE* ip = (const BYTE*) src;
const BYTE* const iend = ip + srcSize;
Expand Down Expand Up @@ -2495,4 +2495,4 @@ char* LZ4_slideInputBuffer (void* state)
return (char *)(uptrval)((LZ4_stream_t*)state)->internal_donotuse.dictionary;
}

#endif /* LZ4_COMMONDEFS_ONLY */
#endif /* LZ4_COMMONDEFS_ONLY */