grub2/grub-core/io
Daniel Axtens 4e76b08f71 io/gzio: Catch missing values in huft_build() and bail
In huft_build(), "v" is a table of values in order of bit length.
The code later (when setting up table entries in "r") assumes that all
elements of this array corresponding to a code are initialized and less
than N_MAX. However, it doesn't enforce this.

With sufficiently manipulated inputs (e.g. from fuzzing), there can be
elements of "v" that are not filled. Therefore a lookup into "e" or "d"
will use an uninitialized value. This can lead to an invalid/OOB read on
those values, often leading to a crash.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-02 15:54:18 +01:00
..
bufio.c Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00
gzio.c io/gzio: Catch missing values in huft_build() and bail 2021-03-02 15:54:18 +01:00
lzopio.c io/lzopio: Resolve unnecessary self-assignment errors 2021-03-02 15:54:16 +01:00
offset.c Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00
xzio.c Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00