[PATCH] D55624: Windows rename_internal function incorrectly passing character count instead of byte count to SetFileInformationByHandle.

Ben Hillis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 15:58:21 PST 2018


benhillis updated this revision to Diff 177964.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55624/new/

https://reviews.llvm.org/D55624

Files:
  lib/Support/Windows/Path.inc


Index: lib/Support/Windows/Path.inc
===================================================================
--- lib/Support/Windows/Path.inc
+++ lib/Support/Windows/Path.inc
@@ -416,7 +416,7 @@
       *reinterpret_cast<FILE_RENAME_INFO *>(RenameInfoBuf.data());
   RenameInfo.ReplaceIfExists = ReplaceIfExists;
   RenameInfo.RootDirectory = 0;
-  RenameInfo.FileNameLength = ToWide.size();
+  RenameInfo.FileNameLength = (ToWide.size() * sizeof(wchar_t));
   std::copy(ToWide.begin(), ToWide.end(), &RenameInfo.FileName[0]);
 
   SetLastError(ERROR_SUCCESS);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55624.177964.patch
Type: text/x-patch
Size: 555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181212/ce97944a/attachment.bin>


More information about the llvm-commits mailing list