When cinelerra try to load a file containing two consecutive dots in its
name (like cinelerra..xml) by the parse_dots function, it jumps to the
parent directory. This because there is not check that the '..' part is
really the parent directory (i.e. contains '/'s before or after).


Signed-off-by: Gianluca Pacchiella <[email protected]>
---

I don't know if this is the correct way to fix that or it breaks something
else; if someone has a better way to do this let me know.

 guicast/filesystem.C |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/guicast/filesystem.C b/guicast/filesystem.C
index 0885d49..4975b0a 100644
--- a/guicast/filesystem.C
+++ b/guicast/filesystem.C
@@ -604,7 +604,8 @@ int FileSystem::parse_dots(char *new_dir)
                changed = 0;
                for(i = 0, j = 1; !changed && j < len; i++, j++)
                {
-                       if(new_dir[i] == '.' && new_dir[j] == '.')
+                       if(new_dir[i] == '.' && new_dir[j] == '.'
+                       && (new_dir[i-1] == '/' || new_dir[j+1] == '/'))
                        {
                                changed = 1;
                                while(new_dir[i] != '/' && i > 0)


_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to