static const struct archive_rb_tree_ops rb_ops = {
isoent_cmp_node_joliet, isoent_cmp_key_joliet
};
+ const int num_size = 6;
+ const int null_size = 2;
if (isoent->children.cnt == 0)
return (0);
else
ffmax = 128;
- r = idr_start(a, idr, isoent->children.cnt, (int)ffmax, 6, 2, &rb_ops);
+ r = idr_start(a, idr, isoent->children.cnt, (int)ffmax, num_size, null_size, &rb_ops);
if (r < 0)
return (r);
if ((l = np->file->basename_utf16.length) > ffmax)
l = ffmax;
- p = malloc((l+1)*2);
+ p = malloc(l + num_size + null_size);
if (p == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory");