]> git.ipfire.org Git - thirdparty/glibc.git/commit
loadarchive: guard against locale-archive corruption (Bug #25115)
authorDJ Delorie <dj@redhat.com>
Fri, 18 Oct 2019 21:15:52 +0000 (17:15 -0400)
committerDJ Delorie <dj@redhat.com>
Sat, 19 Oct 2019 00:40:54 +0000 (20:40 -0400)
commitef21bd2d8c6805c0c186a01f7c5039189f51b8c4
treee5b1cd6c840e63bccd13bfbe05e7219aefc31f7a
parenta807613bcff42dfacfe0961fa60e95c988ab6e92
loadarchive: guard against locale-archive corruption (Bug #25115)

_nl_load_locale_from_archive() checks for a zero size, but
divides by both (size) and (size-2).  Extend the check to
guard against a size of two or less.

Tested by manually corrupting locale-archive and running a program
that calls setlocale() with LOCPATH unset (size is typically very
large).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
locale/loadarchive.c