Bug fix: Use of freed memory with -hardlinks on and -update

This commit is contained in:
Thomas Schmitt 2009-08-03 07:59:04 +00:00
parent 2606a34ba8
commit d69de85874
2 changed files with 8 additions and 4 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.07.25.181857"
#define Xorriso_timestamP "2009.08.03.075954"

View File

@ -7443,6 +7443,8 @@ int Xorriso_report_damage(struct XorrisO *xorriso, char *show_path,
}
/* @return see Xorriso_update_interpreter()
*/
int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter,
IsoNode *node,
char *abs_path, char *iso_prefix, char *disk_prefix,
@ -7479,7 +7481,7 @@ int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter,
abs_path, 1);
if(ret <= 0)
return(ret);
return 1;
return(ret);
}
@ -7584,6 +7586,8 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
Findjob_get_start_path(job, &iso_prefix, 0);
ret= Xorriso_widen_hardlink(xorriso, (void *) boss_iter, node, abs_path,
iso_prefix, target, 0);
if(ret==2)
deleted= 1;
} else { /* includes : 15 in_iso */
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
@ -11998,7 +12002,7 @@ int Xorriso_hardlink_update(struct XorrisO *xorriso, int *compare_result,
/* Handle eventual hardlink split : */
/* This is achieved by setting the content change bit. Reason:
The node needs to be removed from di_array because its di is
not matching it array index any more. So it becomes invisible for
not matching its array index any more. So it becomes invisible for
the join check of eventual later hardlink siblings. Therefore
it must be updated now, even if it has currently no siblings
which it leaves or which it joins.
@ -12114,7 +12118,7 @@ int Xorriso_finish_hl_update(struct XorrisO *xorriso, int flag)
{ret= 1; goto ex;}
disk_lst= xorriso->di_disk_paths;
iso_lst= xorriso->di_iso_paths;
while(disk_lst != 0 && iso_lst != NULL) {
while(disk_lst != NULL && iso_lst != NULL) {
argv[0]= Xorriso_lst_get_text(iso_lst, 0);
argv[1]= "-exec";
argv[2]= "widen_hardlinks";