Lidong Chen 40e261b89b lib/LzmaEnc: Validate "len" before subtracting
In LzmaEnc_CodeOneBlock(), both GetOptimumFast() and GetOptimum()
returns a value of greater or equal to 1, which is assigned to
"len". But since LZMA_MATCH_LEN_MIN == 2, "len" should be validated
before performing "len - LZMA_MATCH_LEN_MIN" to avoid underflow
when "len" equals to 1.

Fixes: CID 51508

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
2025-06-17 13:37:31 +02:00
..
2011-05-13 16:36:05 +02:00
2017-05-08 20:53:28 +02:00
2010-08-30 00:54:15 +02:00
2024-11-28 21:50:53 +01:00
2021-12-23 01:05:34 +01:00
2022-03-14 15:47:13 +01:00
2022-03-14 15:47:13 +01:00
2019-02-25 11:28:44 +01:00
2025-04-10 18:04:48 +02:00
2016-10-27 16:22:06 +02:00
2022-03-14 15:47:13 +01:00
2011-07-05 20:24:20 +02:00
2022-03-14 15:47:13 +01:00
2012-02-26 18:09:07 +01:00
2022-03-14 15:47:13 +01:00
2013-12-18 05:28:05 +01:00
2016-02-12 12:39:38 +01:00
2025-04-04 19:31:05 +02:00
2023-05-17 12:51:50 +02:00