]> git.ipfire.org Git - thirdparty/libarchive.git/commit
xar: guard against file entries containing multiple name elements (#2236)
authorDustin L. Howett <dustin@howett.net>
Sat, 15 Jun 2024 00:13:42 +0000 (19:13 -0500)
committerGitHub <noreply@github.com>
Sat, 15 Jun 2024 00:13:42 +0000 (17:13 -0700)
commite3c0c8d4800fda6b92bc1c50d3ece82ae688dae5
tree21e8d84fceffbbd87bfcf000c60ecf3f7b063241
parent6ee1eebefdf41f36ef1a548c9a7000d132c453f3
xar: guard against file entries containing multiple name elements (#2236)

It appears that there are xar archives (in the form of Apple .pkg files)
that contain TOCs with duplicated name elements:

```xml
<file id="25">
  <data> ... </data>
  <type>file</type>
  <name>PackageInfo</name>
  <name>PackageInfo</name>
  <name>PackageInfo</name>
</file>
```

When libarchive encounters one such file, it will produce an
archive_entry named PackageInfoPackageInfoPackageInfo.

To produce a test archive, the XAR writer was modified to emit two name
elements.
Makefile.am
libarchive/archive_read_support_format_xar.c
libarchive/test/test_read_format_xar.c
libarchive/test/test_read_format_xar_duplicate_filename_node.xar.uu [new file with mode: 0644]