From 7e38a29656954af0bd105bac653a7564cabd5a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 11 Mar 2014 09:50:02 +0100 Subject: [PATCH] Avoided double opening of parent directory name in ntfscp Double openings of a file or directory lead to double memory copies and may lead to inconsistencies. On such situation could occur in ntfscp. --- ntfsprogs/ntfscp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntfsprogs/ntfscp.c b/ntfsprogs/ntfscp.c index 1167d2a3..4173d651 100644 --- a/ntfsprogs/ntfscp.c +++ b/ntfsprogs/ntfscp.c @@ -984,7 +984,7 @@ int main(int argc, char *argv[]) strcat(overwrite_filename, "/"); } strcat(overwrite_filename, filename); - ni = ntfs_pathname_to_inode(vol, NULL, overwrite_filename); + ni = ntfs_pathname_to_inode(vol, dir_ni, overwrite_filename); /* Does a file with the same name exist in the dest dir? */ if (ni) { ntfs_log_verbose("Destination path has a file with "