From 7966b52a5b21dbec0b6001f1194bfbe66bb9034f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 3 Aug 2009 07:59:04 +0000 Subject: [PATCH] Bug fix: Use of freed memory with -hardlinks on and -update --- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index c58a7a4f..c58b3bcb 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.07.25.181857" +#define Xorriso_timestamP "2009.08.03.075954" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index f44f3a85..821dc9e7 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -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";