grub/grub-core
Konrad Rzeszutek Wilk 16c0dbf4bc lzma: Make sure we don't dereference past array
The two dimensional array p->posSlotEncoder[4][64] is being dereferenced
using the GetLenToPosState() macro which checks if len is less than 5,
and if so subtracts 2 from it. If len = 0, that is 0 - 2 = 4294967294.
Obviously we don't want to dereference that far out so we check if the
position found is greater or equal kNumLenToPosStates (4) and bail out.

N.B.: Upstream LZMA 18.05 and later has this function completely rewritten
without any history.

Fixes: CID 51526

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-07-29 16:55:48 +02:00
..
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2017-08-14 16:27:10 +02:00
2017-05-03 12:49:31 +02:00
2013-04-27 02:00:16 +02:00
2019-02-25 14:02:05 +01:00
2017-05-03 12:49:31 +02:00