diff options
Diffstat (limited to 'Swiften/StringCodecs/SHA1.cpp')
-rw-r--r-- | Swiften/StringCodecs/SHA1.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Swiften/StringCodecs/SHA1.cpp b/Swiften/StringCodecs/SHA1.cpp index 18fde71..e59836c 100644 --- a/Swiften/StringCodecs/SHA1.cpp +++ b/Swiften/StringCodecs/SHA1.cpp @@ -188,11 +188,12 @@ boost::uint8_t finalcount[8]; namespace Swift { ByteArray SHA1::getBinaryHash(const ByteArray& input) { + ByteArray inputCopy(input); ByteArray digest; digest.resize(20); SHA1_CTX context; SHA1Init(&context); - SHA1Update(&context, (boost::uint8_t*) input.getData(), input.getSize()); + SHA1Update(&context, (boost::uint8_t*) inputCopy.getData(), inputCopy.getSize()); SHA1Final((boost::uint8_t*) digest.getData(), &context); return digest; } |