358
361
} primary, joliet;
360
off_t entry_sparse_offset;
363
int64_t entry_sparse_offset;
361
364
int64_t entry_bytes_remaining;
365
size_t entry_bytes_unconsumed;
362
366
struct zisofs entry_zisofs;
363
367
struct content *entry_content;
368
struct archive_string_conv *sconv_utf16be;
370
* Buffers for a full pathname in UTF-16BE in Joliet extensions.
372
#define UTF16_NAME_MAX 1024
373
unsigned char *utf16be_path;
374
size_t utf16be_path_len;
375
unsigned char *utf16be_previous_path;
376
size_t utf16be_previous_path_len;
366
static int archive_read_format_iso9660_bid(struct archive_read *);
379
static int archive_read_format_iso9660_bid(struct archive_read *, int);
367
380
static int archive_read_format_iso9660_options(struct archive_read *,
368
381
const char *, const char *);
369
382
static int archive_read_format_iso9660_cleanup(struct archive_read *);
370
383
static int archive_read_format_iso9660_read_data(struct archive_read *,
371
const void **, size_t *, off_t *);
384
const void **, size_t *, int64_t *);
372
385
static int archive_read_format_iso9660_read_data_skip(struct archive_read *);
373
386
static int archive_read_format_iso9660_read_header(struct archive_read *,
374
387
struct archive_entry *);
375
388
static const char *build_pathname(struct archive_string *, struct file_info *);
389
static int build_pathname_utf16be(unsigned char *, size_t, size_t *,
377
392
static void dump_isodirrec(FILE *, const unsigned char *isodirrec);
388
403
static int isPVD(struct iso9660 *, const unsigned char *);
389
404
static int next_cache_entry(struct archive_read *, struct iso9660 *,
390
405
struct file_info **);
391
static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660,
392
struct file_info **pfile);
406
static int next_entry_seek(struct archive_read *, struct iso9660 *,
407
struct file_info **);
393
408
static struct file_info *
394
409
parse_file_info(struct archive_read *a,
395
410
struct file_info *parent, const unsigned char *isodirrec);
433
448
struct iso9660 *iso9660;
436
iso9660 = (struct iso9660 *)malloc(sizeof(*iso9660));
451
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
452
ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
454
iso9660 = (struct iso9660 *)calloc(1, sizeof(*iso9660));
437
455
if (iso9660 == NULL) {
438
archive_set_error(&a->archive, ENOMEM, "Can't allocate iso9660 data");
456
archive_set_error(&a->archive, ENOMEM,
457
"Can't allocate iso9660 data");
439
458
return (ARCHIVE_FATAL);
441
memset(iso9660, 0, sizeof(*iso9660));
442
460
iso9660->magic = ISO9660_MAGIC;
443
461
iso9660->cache_files.first = NULL;
444
462
iso9660->cache_files.last = &(iso9660->cache_files.first);
484
506
* if the I/O layer gives us more, we'll take it.
486
508
#define RESERVED_AREA (SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
487
h = __archive_read_ahead(a,
509
p = __archive_read_ahead(a,
488
510
RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
492
p = (const unsigned char *)h;
494
515
/* Skip the reserved area. */
495
516
bytes_read -= RESERVED_AREA;
910
931
if (p[DR_length_offset] != 34)
913
iso9660->logical_block_size = logical_block_size;
914
iso9660->volume_block = volume_block;
915
iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
916
iso9660->primary.location = archive_le32dec(p + DR_extent_offset);
917
iso9660->primary.size = archive_le32dec(p + DR_size_offset);
934
if (!iso9660->primary.location) {
935
iso9660->logical_block_size = logical_block_size;
936
iso9660->volume_block = volume_block;
937
iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
938
iso9660->primary.location = archive_le32dec(p + DR_extent_offset);
939
iso9660->primary.size = archive_le32dec(p + DR_size_offset);
1010
1035
con->next = NULL;
1011
1036
*multi->contents.last = con;
1012
1037
multi->contents.last = &(con->next);
1013
if (multi == child) {
1014
if (add_entry(a, iso9660, child)
1016
return (ARCHIVE_FATAL);
1038
if (multi == child) {
1039
if (add_entry(a, iso9660, child)
1041
return (ARCHIVE_FATAL);
1018
1043
multi->size += child->size;
1019
1044
if (!child->multi_extent)
1023
if (add_entry(a, iso9660, child)
1025
return (ARCHIVE_FATAL);
1048
if (add_entry(a, iso9660, child) != ARCHIVE_OK)
1049
return (ARCHIVE_FATAL);
1053
__archive_read_consume(a, skip_size);
1029
1055
/* Read data which recorded by RRIP "CE" extension. */
1030
1056
if (read_CE(a, iso9660) != ARCHIVE_OK)
1031
1057
return (ARCHIVE_FATAL);
1160
file = NULL;/* Eliminate a warning. */
1135
1161
/* Get the next entry that appears after the current offset. */
1136
1162
r = next_entry_seek(a, iso9660, &file);
1137
1163
if (r != ARCHIVE_OK)
1166
if (iso9660->seenJoliet) {
1168
* Convert UTF-16BE of a filename to local locale MBS
1169
* and store the result into a filename field.
1171
if (iso9660->sconv_utf16be == NULL) {
1172
iso9660->sconv_utf16be =
1173
archive_string_conversion_from_charset(
1174
&(a->archive), "UTF-16BE", 1);
1175
if (iso9660->sconv_utf16be == NULL)
1176
/* Coundn't allocate memory */
1177
return (ARCHIVE_FATAL);
1179
if (iso9660->utf16be_path == NULL) {
1180
iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
1181
if (iso9660->utf16be_path == NULL) {
1182
archive_set_error(&a->archive, ENOMEM,
1184
return (ARCHIVE_FATAL);
1187
if (iso9660->utf16be_previous_path == NULL) {
1188
iso9660->utf16be_previous_path = malloc(UTF16_NAME_MAX);
1189
if (iso9660->utf16be_previous_path == NULL) {
1190
archive_set_error(&a->archive, ENOMEM,
1192
return (ARCHIVE_FATAL);
1196
iso9660->utf16be_path_len = 0;
1197
if (build_pathname_utf16be(iso9660->utf16be_path,
1198
UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
1199
archive_set_error(&a->archive,
1200
ARCHIVE_ERRNO_FILE_FORMAT,
1201
"Pathname is too long");
1204
r = archive_entry_copy_pathname_l(entry,
1205
(const char *)iso9660->utf16be_path,
1206
iso9660->utf16be_path_len,
1207
iso9660->sconv_utf16be);
1209
if (errno == ENOMEM) {
1210
archive_set_error(&a->archive, ENOMEM,
1211
"No memory for Pathname");
1212
return (ARCHIVE_FATAL);
1214
archive_set_error(&a->archive,
1215
ARCHIVE_ERRNO_FILE_FORMAT,
1216
"Pathname cannot be converted "
1217
"from %s to current locale.",
1218
archive_string_conversion_charset_name(
1219
iso9660->sconv_utf16be));
1221
rd_r = ARCHIVE_WARN;
1224
archive_string_empty(&iso9660->pathname);
1225
archive_entry_set_pathname(entry,
1226
build_pathname(&iso9660->pathname, file));
1140
1229
iso9660->entry_bytes_remaining = file->size;
1141
1230
iso9660->entry_sparse_offset = 0; /* Offset for sparse-file-aware clients. */
1143
1232
if (file->offset + file->size > iso9660->volume_size) {
1144
1233
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
1145
"File is beyond end-of-media: %s", file->name.s);
1234
"File is beyond end-of-media: %s",
1235
archive_entry_pathname(entry));
1146
1236
iso9660->entry_bytes_remaining = 0;
1147
1237
iso9660->entry_sparse_offset = 0;
1148
1238
return (ARCHIVE_WARN);
1163
1253
/* N.B.: Rock Ridge supports 64-bit device numbers. */
1164
1254
archive_entry_set_rdev(entry, (dev_t)file->rdev);
1165
1255
archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
1166
archive_string_empty(&iso9660->pathname);
1167
archive_entry_set_pathname(entry,
1168
build_pathname(&iso9660->pathname, file));
1169
1256
if (file->symlink.s != NULL)
1170
1257
archive_entry_copy_symlink(entry, file->symlink.s);
1175
1262
* original entry. */
1176
1263
if (file->number != -1 &&
1177
1264
file->number == iso9660->previous_number) {
1178
archive_entry_set_hardlink(entry,
1179
iso9660->previous_pathname.s);
1265
if (iso9660->seenJoliet) {
1266
r = archive_entry_copy_hardlink_l(entry,
1267
(const char *)iso9660->utf16be_previous_path,
1268
iso9660->utf16be_previous_path_len,
1269
iso9660->sconv_utf16be);
1271
if (errno == ENOMEM) {
1272
archive_set_error(&a->archive, ENOMEM,
1273
"No memory for Linkname");
1274
return (ARCHIVE_FATAL);
1276
archive_set_error(&a->archive,
1277
ARCHIVE_ERRNO_FILE_FORMAT,
1278
"Linkname cannot be converted "
1279
"from %s to current locale.",
1280
archive_string_conversion_charset_name(
1281
iso9660->sconv_utf16be));
1282
rd_r = ARCHIVE_WARN;
1285
archive_entry_set_hardlink(entry,
1286
iso9660->previous_pathname.s);
1180
1287
archive_entry_unset_size(entry);
1181
1288
iso9660->entry_bytes_remaining = 0;
1182
1289
iso9660->entry_sparse_offset = 0;
1183
return (ARCHIVE_OK);
1186
1293
/* Except for the hardlink case above, if the offset of the
1231
1339
iso9660->previous_number = file->number;
1232
archive_strcpy(&iso9660->previous_pathname, iso9660->pathname.s);
1340
if (iso9660->seenJoliet) {
1341
memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
1342
iso9660->utf16be_path_len);
1343
iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
1346
&iso9660->previous_pathname, iso9660->pathname.s);
1234
1348
/* Reset entry_bytes_remaining if the file is multi extent. */
1235
1349
iso9660->entry_content = file->contents.first;
1397
1511
if (zisofs->block_off + 4 >= zisofs->block_pointers_size) {
1398
1512
/* There isn't a pair of offsets. */
1399
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
1513
archive_set_error(&a->archive,
1514
ARCHIVE_ERRNO_FILE_FORMAT,
1400
1515
"Illegal zisofs block pointers");
1401
1516
return (ARCHIVE_FATAL);
1403
bst = archive_le32dec(zisofs->block_pointers + zisofs->block_off);
1518
bst = archive_le32dec(
1519
zisofs->block_pointers + zisofs->block_off);
1404
1520
if (bst != zisofs->pz_offset + (bytes_read - avail)) {
1405
/* TODO: Should we seek offset of current file by bst ? */
1406
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
1521
/* TODO: Should we seek offset of current file
1523
archive_set_error(&a->archive,
1524
ARCHIVE_ERRNO_FILE_FORMAT,
1407
1525
"Illegal zisofs block pointers(cannot seek)");
1408
1526
return (ARCHIVE_FATAL);
1410
1528
bed = archive_le32dec(
1411
1529
zisofs->block_pointers + zisofs->block_off + 4);
1412
1530
if (bed < bst) {
1413
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
1531
archive_set_error(&a->archive,
1532
ARCHIVE_ERRNO_FILE_FORMAT,
1414
1533
"Illegal zisofs block pointers");
1415
1534
return (ARCHIVE_FATAL);
1498
1617
archive_read_format_iso9660_read_data(struct archive_read *a,
1499
const void **buff, size_t *size, off_t *offset)
1618
const void **buff, size_t *size, int64_t *offset)
1501
1620
ssize_t bytes_read;
1502
1621
struct iso9660 *iso9660;
1504
1623
iso9660 = (struct iso9660 *)(a->format->data);
1625
if (iso9660->entry_bytes_unconsumed) {
1626
__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
1627
iso9660->entry_bytes_unconsumed = 0;
1505
1630
if (iso9660->entry_bytes_remaining <= 0) {
1506
1631
if (iso9660->entry_content != NULL)
1507
1632
iso9660->entry_content = iso9660->entry_content->next;
1634
1761
"Invalid location of extent of file");
1764
/* Sanity check that location doesn't have a negative value
1765
* when the file is not empty. it's too large. */
1766
if (fsize != 0 && location < 0) {
1767
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
1768
"Invalid location of extent of file");
1638
1772
/* Create a new file entry and copy data from the ISO dir record. */
1639
file = (struct file_info *)malloc(sizeof(*file));
1773
file = (struct file_info *)calloc(1, sizeof(*file));
1640
1774
if (file == NULL) {
1641
1775
archive_set_error(&a->archive, ENOMEM,
1642
1776
"No memory for file entry");
1645
memset(file, 0, sizeof(*file));
1646
1779
file->parent = parent;
1647
1780
file->offset = iso9660->logical_block_size * (uint64_t)location;
1648
1781
file->size = fsize;
1663
1796
* names which are 103 UCS2 characters(206 bytes) by their
1664
1797
* option '-joliet-long'.
1666
wchar_t wbuff[103+1], *wp;
1667
const unsigned char *c;
1669
1799
if (name_len > 206)
1670
1800
name_len = 206;
1671
/* convert BE UTF-16 to wchar_t */
1672
for (c = p, wp = wbuff;
1673
c < (p + name_len) &&
1674
wp < (wbuff + sizeof(wbuff)/sizeof(*wbuff) - 1);
1676
*wp++ = (((255 & (int)c[0]) << 8) | (255 & (int)c[1]));
1680
1803
/* trim trailing first version and dot from filename.
1682
* Remember we where in UTF-16BE land!
1805
* Remember we were in UTF-16BE land!
1683
1806
* SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
1684
1807
* 16 bits big endian characters on Joliet.
1688
1811
* *, /, :, ;, ? and \.
1690
1813
/* Chop off trailing ';1' from files. */
1691
if (*(wp-2) == L';' && *(wp-1) == L'1') {
1814
if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
1815
&& p[name_len-2] == 0 && p[name_len-1] == '1')
1696
1817
#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
1697
1818
/* Chop off trailing '.' from filenames. */
1698
if (*(wp-1) == L'.')
1819
if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
1702
/* store the result in the file name field. */
1703
archive_strappend_w_utf8(&file->name, wbuff);
1822
if ((file->utf16be_name = malloc(name_len)) == NULL) {
1823
archive_set_error(&a->archive, ENOMEM,
1824
"No memory for file name");
1827
memcpy(file->utf16be_name, p, name_len);
1828
file->utf16be_bytes = name_len;
1705
1830
/* Chop off trailing ';1' from files. */
1706
1831
if (name_len > 2 && p[name_len - 2] == ';' &&
1724
1849
file->multi_extent = 0;
1726
* Use location for file number.
1727
* File number is treated as inode number to find out harlink
1728
* target. If Rockridge extensions is being used, file number
1729
* will be overwritten by FILE SERIAL NUMBER of RRIP "PX"
1731
* NOTE: Old mkisofs did not record that FILE SERIAL NUMBER
1851
* Use a location for the file number, which is treated as an inode
1852
* number to find out hardlink target. If Rockridge extensions is
1853
* being used, the file number will be overwritten by FILE SERIAL
1854
* NUMBER of RRIP "PX" extension.
1855
* Note: Old mkisofs did not record that FILE SERIAL NUMBER
1732
1856
* in ISO images.
1857
* Note2: xorriso set 0 to the location of a symlink file.
1734
1859
if (file->size == 0 && location >= 0) {
1735
/* If file->size is zero, its location points wrong place.
1736
* Dot not use it for file number.
1737
* When location has negative value, it can be used
1860
/* If file->size is zero, its location points wrong place,
1861
* and so we should not use it for the file number.
1862
* When the location has negative value, it can be used
1863
* for the file number.
1740
1865
file->number = -1;
1741
/* Do not appear before any directoy entries. */
1742
if (file->offset == 0)
1866
/* Do not appear before any directory entries. */
1745
1869
file->number = (int64_t)(uint32_t)location;
1806
1930
parent->subdirs--;
1807
1931
} else if (file->re) {
1808
/* This file's parent is not rr_moved, clear invalid
1810
if (parent == NULL || parent->rr_moved == 0)
1812
else if ((flags & 0x02) == 0) {
1813
file->rr_moved_has_re_only = 0;
1933
* Sanity check: file's parent is rr_moved.
1935
if (parent == NULL || parent->rr_moved == 0) {
1936
archive_set_error(&a->archive,
1938
"Invalid Rockridge RE");
1942
* Sanity check: file does not have "CL" extension.
1944
if (file->cl_offset) {
1945
archive_set_error(&a->archive,
1947
"Invalid Rockridge RE and CL");
1951
* Sanity check: The file type must be a directory.
1953
if ((flags & 0x02) == 0) {
1954
archive_set_error(&a->archive,
1956
"Invalid Rockridge RE");
1816
1959
} else if (parent != NULL && parent->rr_moved)
1817
1960
file->rr_moved_has_re_only = 0;
1818
1961
else if (parent != NULL && (flags & 0x02) &&
1819
1962
(parent->re || parent->re_descendant))
1820
1963
file->re_descendant = 1;
1821
if (file->cl_offset != 0) {
1964
if (file->cl_offset) {
1965
struct file_info *r;
1967
if (parent == NULL || parent->parent == NULL) {
1968
archive_set_error(&a->archive,
1970
"Invalid Rockridge CL");
1974
* Sanity check: The file type must be a regular file.
1976
if ((flags & 0x02) != 0) {
1977
archive_set_error(&a->archive,
1979
"Invalid Rockridge CL");
1822
1982
parent->subdirs++;
1823
1983
/* Overwrite an offset and a number of this "CL" entry
1824
1984
* to appear before other dirs. "+1" to those is to
1825
1985
* make sure to appear after "RE" entry which this
1826
1986
* "CL" entry should be connected with. */
1827
1987
file->offset = file->number = file->cl_offset + 1;
1990
* Sanity check: cl_offset does not point at its
1991
* the parents or itself.
1993
for (r = parent; r; r = r->parent) {
1994
if (r->offset == file->cl_offset) {
1995
archive_set_error(&a->archive,
1997
"Invalid Rockridge CL");
2001
if (file->cl_offset == file->offset ||
2003
archive_set_error(&a->archive,
2005
"Invalid Rockridge CL");
2052
2239
offset = ((uint64_t)location) * (uint64_t)iso9660->logical_block_size;
2053
2240
if (((file->mode & AE_IFMT) == AE_IFREG &&
2054
2241
offset >= file->offset) ||
2055
offset < iso9660->current_position) {
2242
offset < iso9660->current_position ||
2243
(((uint64_t)file->ce_offset) + file->ce_size)
2244
> iso9660->logical_block_size ||
2245
offset + file->ce_offset + file->ce_size
2246
> iso9660->volume_size) {
2056
2247
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
2057
"Invalid location in SUSP \"CE\" extension");
2248
"Invalid parameter in SUSP \"CE\" extension");
2058
2249
return (ARCHIVE_FATAL);
2069
2260
new_size = heap->allocated * 2;
2070
2261
/* Overflow might keep us from growing the list. */
2071
if (new_size <= heap->allocated)
2072
__archive_errx(1, "Out of memory");
2262
if (new_size <= heap->allocated) {
2263
archive_set_error(&a->archive, ENOMEM, "Out of memory");
2264
return (ARCHIVE_FATAL);
2073
2266
p = malloc(new_size * sizeof(p[0]));
2075
__archive_errx(1, "Out of memory");
2268
archive_set_error(&a->archive, ENOMEM, "Out of memory");
2269
return (ARCHIVE_FATAL);
2076
2271
if (heap->reqs != NULL) {
2077
2272
memcpy(p, heap->reqs, heap->cnt * sizeof(*p));
2078
2273
free(heap->reqs);
2121
2316
* Rebalance the heap.
2123
a = 0; // Starting element and its offset
2318
a = 0; /* Starting element and its offset */
2124
2319
a_offset = heap->reqs[a].offset;
2126
b = a + a + 1; // First child
2321
b = a + a + 1; /* First child */
2127
2322
if (b >= heap->cnt)
2129
2324
b_offset = heap->reqs[b].offset;
2130
c = b + 1; // Use second child if it is smaller.
2325
c = b + 1; /* Use second child if it is smaller. */
2131
2326
if (c < heap->cnt) {
2132
2327
c_offset = heap->reqs[c].offset;
2133
2328
if (c_offset < b_offset) {
2210
2411
if (data_length < 2)
2212
archive_strncat(&file->name, (const char *)data + 1, data_length - 1);
2413
archive_strncat(&file->name,
2414
(const char *)data + 1, data_length - 1);
2215
2417
if (data_length < 2)
2217
archive_strncat(&file->name, (const char *)data + 1, data_length - 1);
2419
archive_strncat(&file->name,
2420
(const char *)data + 1, data_length - 1);
2218
2421
file->name_continues = 1;
2452
2656
if (file->size == 0)
2453
2657
file->offset = iso9660->current_position;
2659
/* flush any remaining bytes from the last round to ensure
2660
* we're positioned */
2661
if (iso9660->entry_bytes_unconsumed) {
2662
__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
2663
iso9660->entry_bytes_unconsumed = 0;
2455
2666
/* Seek forward to the start of the entry. */
2456
2667
if (iso9660->current_position < file->offset) {
2459
2670
step = file->offset - iso9660->current_position;
2460
step = __archive_read_skip(a, step);
2671
step = __archive_read_consume(a, step);
2462
2673
return ((int)step);
2463
2674
iso9660->current_position = file->offset;
2745
2959
if ((file = iso9660->cache_files.first) != NULL) {
2746
2960
iso9660->cache_files.first = file->next;
2747
2961
if (iso9660->cache_files.first == NULL)
2748
iso9660->cache_files.last = &(iso9660->cache_files.first);
2962
iso9660->cache_files.last =
2963
&(iso9660->cache_files.first);
2754
heap_add_entry(struct archive_read *a, struct heap_queue *heap, struct file_info *file, uint64_t key)
2969
heap_add_entry(struct archive_read *a, struct heap_queue *heap,
2970
struct file_info *file, uint64_t key)
2756
2972
uint64_t file_key, parent_key;
2757
2973
int hole, parent;
2830
3046
* Rebalance the heap.
2832
a = 0; // Starting element and its heap key
3048
a = 0; /* Starting element and its heap key */
2833
3049
a_key = heap->files[a]->key;
2835
b = a + a + 1; // First child
3051
b = a + a + 1; /* First child */
2836
3052
if (b >= heap->used)
2838
3054
b_key = heap->files[b]->key;
2839
c = b + 1; // Use second child if it is smaller.
3055
c = b + 1; /* Use second child if it is smaller. */
2840
3056
if (c < heap->used) {
2841
3057
c_key = heap->files[c]->key;
2842
3058
if (c_key < b_key) {
2941
3159
return (as->s);
3163
build_pathname_utf16be(unsigned char *p, size_t max, size_t *len,
3164
struct file_info *file)
3166
if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
3167
if (build_pathname_utf16be(p, max, len, file->parent) != 0)
3173
if (file->utf16be_bytes == 0) {
3175
return (-1);/* Path is too long! */
3180
if (*len + file->utf16be_bytes > max)
3181
return (-1);/* Path is too long! */
3182
memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
3183
*len += file->utf16be_bytes;
2946
3190
dump_isodirrec(FILE *out, const unsigned char *isodirrec)