diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-20 23:00:21 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-20 23:00:21 +0100 |
commit | 0f0a58f94f65d3c84e1ab46d91e21f776507e080 (patch) | |
tree | d61c593d69c59a7dc664ddbf805d0b5eec962ece /src | |
parent | f6effe4934d4d97f255d119e8f95b91f14e70cb1 (diff) |
udeflate: fix off-by-one in uncompressed size check
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/udeflate.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/udeflate.cc b/src/lib/udeflate.cc index df7c179..c3a051d 100644 --- a/src/lib/udeflate.cc +++ b/src/lib/udeflate.cc @@ -290,10 +290,10 @@ static int8_t udeflate_uncompressed() return UDEFLATE_ERR_NLEN; } udeflate_input_now += 4; - if (udeflate_input_now + len > udeflate_input_end) { + if (udeflate_input_now + len >= udeflate_input_end) { return UDEFLATE_ERR_INPUT_LENGTH; } - if (udeflate_output_now + len > udeflate_output_end) { + if (udeflate_output_now + len >= udeflate_output_end) { return UDEFLATE_ERR_OUTPUT_LENGTH; } for (uint16_t i = 0; i < len; i++) { |