Fix dec64table[] OOB read in b64decode()
authorTomas Hoger <thoger@redhat.com>
Wed, 7 Mar 2018 10:30:18 +0000 (11:30 +0100)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Mon, 12 Mar 2018 21:16:55 +0000 (22:16 +0100)
Possible values for y at this point are 0..255.  However, dec64table[]
only has 128 entries and hence valid indexes are 0..127.  The values of
y greater than 127 trigger out of bounds read.  As dec64table[] is in
the data segment, the OOB access is not detected by tools as valgrind or
ASAN.  This adds a check to ensure y is less than or equal to 127, just
like in other cases where dec64table[] is accessed.

Note that removal of the y == 0 condition is not a problem, as
dec64table[0] == 255, so the second part of the condition is true.


No differences found