[Cmake-commits] CMake branch, next, updated. v2.8.11.1-2616-g349ce84
Brad King
brad.king at kitware.com
Thu Jun 13 08:46:15 EDT 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 349ce8462282c2036b427aa3d790ff97955c861f (commit)
via 75994d953e261b388aa31e4d8ecd8af9fe53142b (commit)
from a0ba36288a4ed0b0e3ebeb339bc8303d778b4225 (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=349ce8462282c2036b427aa3d790ff97955c861f
commit 349ce8462282c2036b427aa3d790ff97955c861f
Merge: a0ba362 75994d9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 13 08:46:12 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 13 08:46:12 2013 -0400
Merge topic 'sha2-alignment' into next
75994d9 cmCryptoHash: Increase alignment of HashFile buffer
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75994d953e261b388aa31e4d8ecd8af9fe53142b
commit 75994d953e261b388aa31e4d8ecd8af9fe53142b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 10 16:52:16 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 13 08:40:10 2013 -0400
cmCryptoHash: Increase alignment of HashFile buffer
The SHA512_Update implementation accesses input data via 64-bit
integers. This requires alignment of the input buffer on some
architectures. Align our stack-allocated buffer for file content to
satisfy this requirement.
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index a1505bd..a4f6ac4 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -54,8 +54,8 @@ std::string cmCryptoHash::HashFile(const char* file)
this->Initialize();
// Should be efficient enough on most system:
- const int bufferSize = 4096;
- char buffer[bufferSize];
+ cm_sha2_uint64_t buffer[512];
+ char* buffer_c = reinterpret_cast<char*>(buffer);
unsigned char const* buffer_uc =
reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
@@ -65,7 +65,7 @@ std::string cmCryptoHash::HashFile(const char* file)
// error occurred. Therefore, the loop should be safe everywhere.
while(fin)
{
- fin.read(buffer, bufferSize);
+ fin.read(buffer_c, sizeof(buffer));
if(int gcount = static_cast<int>(fin.gcount()))
{
this->Append(buffer_uc, gcount);
-----------------------------------------------------------------------
Summary of changes:
Source/cmCryptoHash.cxx | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list