pvfs_resolve: fix endless loop with trailing ".."
authorStefan Metzmacher <metze@samba.org>
Fri, 29 Feb 2008 12:04:08 +0000 (13:04 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 29 Feb 2008 14:17:52 +0000 (15:17 +0100)
We also need to move the NULL termination.

metze

source/ntvfs/posix/pvfs_resolve.c

index 2bfc47b..c129038 100644 (file)
@@ -399,7 +399,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
                if (ISDOTDOT(components[i])) {
                        if (i < 1) return NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
                        memmove(&components[i-1], &components[i+1], 
-                               sizeof(char *)*(num_components-(i+1)));
+                               sizeof(char *)*(num_components-i));
                        i -= 2;
                        continue;
                }