Bug fix: Random target filenames with looping symbolic links

This commit is contained in:
Thomas Schmitt 2008-10-05 09:37:44 +00:00
parent bcbec3c769
commit 58a819003f
2 changed files with 5 additions and 2 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.10.05.075432"
#define Xorriso_timestamP "2008.10.05.093703"

View File

@ -1859,7 +1859,7 @@ int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir,
sfe2= malloc(5*SfileadrL);
disk_path= malloc(2*SfileadrL);
img_path= malloc(2*SfileadrL);
link_target= malloc(SfileadrL);
link_target= calloc(SfileadrL, 1);
if(sfe==NULL || sfe2==NULL || disk_path==NULL || img_path==NULL ||
link_target==NULL) {
Xorriso_no_malloc_memory(xorriso, &sfe, 0);
@ -1968,6 +1968,9 @@ cannot_lstat:;
} else {
if(Xorriso_eval_problem_status(xorriso, 0, 1|2)<0)
{ret= 0; goto was_problem;}
ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1);
if(ret<=0)
goto was_problem;
}
} else if (S_ISLNK(stbuf.st_mode)) {
ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1);