glibc/locale/programs
Aurelien Jarno cbab7f7268 localedef: check magic value on archive load [BZ #28650]
localedef currently blindly trust the archive header. When passed an
archive file with the wrong endianess, this leads to a segmentation
fault:

  $ localedef --big-endian --list-archive /usr/lib/locale/locale-archive
  Segmentation fault (core dumped)

When passed non-archive files, asserts are reported on the best case,
but sometimes it can lead to a segmentation fault:

  $ localedef --list-archive /bin/true
  localedef: programs/locarchive.c:1643: show_archive_content: Assertion `used < GET (head->namehash_used)' failed.
  Aborted (core dumped)

  $ localedef --list-archive /usr/lib/locale/C.utf8/LC_COLLATE
  Segmentation fault (core dumped)

This patch improves the user experience by looking at the magic value,
which is always written, but never checked. It should still be possible
to trigger a segmentation fault with crafted files, but this already
catch many cases.
2021-12-07 23:32:53 +01:00
..
3level.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
charmap-dir.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
charmap-dir.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
charmap-kw.gperf Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
charmap-kw.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
charmap.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
charmap.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
config.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-address.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-collate.c Add 'codepoint_collation' support for LC_COLLATE. 2021-09-06 11:06:45 -04:00
ld-ctype.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-identification.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-measurement.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-messages.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-monetary.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-name.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-numeric.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-paper.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-telephone.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ld-time.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
linereader.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
linereader.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
locale-spec.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
locale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
localedef.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
localedef.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
locarchive.c localedef: check magic value on archive load [BZ #28650] 2021-12-07 23:32:53 +01:00
locfile-kw.gperf Add 'codepoint_collation' support for LC_COLLATE. 2021-09-06 11:06:45 -04:00
locfile-kw.h Add 'codepoint_collation' support for LC_COLLATE. 2021-09-06 11:06:45 -04:00
locfile-token.h Add 'codepoint_collation' support for LC_COLLATE. 2021-09-06 11:06:45 -04:00
locfile.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
locfile.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
record-status.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
record-status.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
repertoire.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
repertoire.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
simple-hash.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
simple-hash.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
xasprintf.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
xmalloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
xstrdup.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00