]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix segfault in iso9660 reader
authorDan McGee <dan@archlinux.org>
Tue, 27 Mar 2012 22:06:32 +0000 (17:06 -0500)
committerDan McGee <dan@archlinux.org>
Tue, 27 Mar 2012 22:25:38 +0000 (17:25 -0500)
commit92c8cd9404459604379f30a5b7587755a499d52a
treef1e36972167514bbe4ff010ea38d2361bcc8684b
parentb6b98394b119296e4b471ce49488378ddd9742eb
Fix segfault in iso9660 reader

Some odd ISO images do some funny things with RockRidge and Joliet data.
In this particular case, Joliet is used on the CD image, but the first
directory record has no RockRidge data. However, subsequent directory
entries (in the Joliet volume descriptor!) have RockRidge data attached,
although what is noticeably missing are type "NM" or name entries.

This causes seenRockridge to get flipped on, which makes the bad
assumption that seenJoliet is false.  This means that when we reach the
code searching for the "rr_moved" special file, we strcmp() against NULL
because our filename is really in file->utf16be_bytes.

This is by far the easiest fix (and likely most correct fix) to this
madness; I have no idea whether a UTF-16 encoded "rr_moved" file can
even exist with whatever mastering software was used on this ISO.

Also note that if you explicitly disable Joliet processing, you get a
very different file listing on this ISO; apparently this is a cleaver
way to hide files from prying eyes in the Windows world:

    $ ./bsdtar -t --options 'iso9660:joliet' -f example.iso | wc -l
    24
    $ ./bsdtar -t --options 'iso9660:!joliet' -f example.iso | wc -l
    3060
libarchive/archive_read_support_format_iso9660.c