New error code ISO_RR_PATH_TOO_LONG.

This commit is contained in:
2011-03-28 15:00:44 +02:00
parent 61383dea2d
commit 71efc996e3
10 changed files with 70 additions and 22 deletions

View File

@@ -342,6 +342,9 @@ int rrip_add_NM(Ecma119Image *t, struct susp_info *susp, char *name, int size,
return ISO_OUT_OF_MEM;
}
if (size > 250)
return ISO_ASSERT_FAILURE;
NM[0] = 'N';
NM[1] = 'M';
NM[2] = size + 5;
@@ -973,6 +976,18 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
*su_size += 28;
}
/* <<< */
#ifdef NIX
{
static int min_free = 1000;
if (space - *su_size < min_free) {
min_free = space - *su_size;
fprintf(stderr, "LIBISOFS_DEBUG: minimum free SUA before NM = %d\n",
min_free);
}
}
#endif /* NIX */
/* NM entry */
if (*su_size + 5 + namelen <= space) {
/* ok, it fits in System Use Area */
@@ -982,6 +997,9 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
if (!(flag & 1))
goto unannounced_ca;
namelen = namelen - (space - *su_size - 5);
/* >>> Need to handle lengths > 250 */;
*ce = 5 + namelen;
*su_size = space;
}
@@ -1659,6 +1677,9 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
/*
* ..and the part that goes to continuation area.
*/
/* >>> Need a loop to handle lengths > 250 */;
ret = rrip_add_NM(t, info, name + namelen, strlen(name + namelen),
0, 1);
if (ret < 0) {