[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6093-gf5631b5

Brad King brad.king at kitware.com
Fri Dec 6 15:14:33 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f5631b5b50e2e543c32c1a2d3d347600753bd20a (commit)
       via  283c0a7e3ca857fb7ef6dabc72faffadc609c200 (commit)
      from  a08972e3d6d9639efa86814e0400f8d3f2512a27 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5631b5b50e2e543c32c1a2d3d347600753bd20a
commit f5631b5b50e2e543c32c1a2d3d347600753bd20a
Merge: a08972e 283c0a7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 6 15:14:31 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 6 15:14:31 2013 -0500

    Merge topic 'unicode-win32-apis' into next
    
    283c0a7 cmFindPackageCommand: Fix RegEnumValueW data size computation


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=283c0a7e3ca857fb7ef6dabc72faffadc609c200
commit 283c0a7e3ca857fb7ef6dabc72faffadc609c200
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 6 15:10:16 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 6 15:10:16 2013 -0500

    cmFindPackageCommand: Fix RegEnumValueW data size computation
    
    RegEnumValue returns ERROR_MORE_DATA if lpcchValueName is larger
    than 32767 _bytes_, so reduce our name[] size to fit within that.
    Also update the lpcbData argument and ERROR_MORE_DATA handling
    to work with the size of the lpData buffer in bytes, not elements.

diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index b9ee8be..55c20d6 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1254,14 +1254,14 @@ void cmFindPackageCommand::LoadPackageRegistryWin(bool user,
                    0, KEY_QUERY_VALUE|view, &hKey) == ERROR_SUCCESS)
     {
     DWORD valueType = REG_NONE;
-    wchar_t name[16384];
+    wchar_t name[16383]; // RegEnumValue docs limit name to 32767 _bytes_
     std::vector<wchar_t> data(512);
     bool done = false;
     DWORD index = 0;
     while(!done)
       {
       DWORD nameSize = static_cast<DWORD>(sizeof(name));
-      DWORD dataSize = static_cast<DWORD>(data.size()-1);
+      DWORD dataSize = static_cast<DWORD>(data.size()*sizeof(data[0]));
       switch(RegEnumValueW(hKey, index, name, &nameSize,
                           0, &valueType, (BYTE*)&data[0], &dataSize))
         {
@@ -1279,7 +1279,7 @@ void cmFindPackageCommand::LoadPackageRegistryWin(bool user,
             }
           break;
         case ERROR_MORE_DATA:
-          data.resize(dataSize+1);
+          data.resize((dataSize+sizeof(data[0])-1)/sizeof(data[0]));
           break;
         case ERROR_NO_MORE_ITEMS: default: done = true; break;
         }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmFindPackageCommand.cxx |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list