[poppler] poppler/Decrypt.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 18 21:14:16 UTC 2018


 poppler/Decrypt.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a49822dc7a149174c6cc51fd163f7fda3fbb6c4
Author: Adam Reichold <adam.reichold at t-online.de>
Date:   Tue Dec 18 21:46:00 2018 +0100

    Copy the string contents, not the string object, into the key buffer. Closes #690

diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index b0f3d835..01e7aadf 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -1717,7 +1717,7 @@ static void revision6Hash(const GooString *inputPassword, unsigned char *K, cons
     sequenceLength = inputPasswordLength + KLength + userKeyLength;
     totalLength = 64 * sequenceLength;
     //a.make the string K1
-    memcpy(K1, inputPassword, inputPasswordLength);
+    memcpy(K1, inputPassword->c_str(), inputPasswordLength);
     memcpy(K1 + inputPasswordLength, K , KLength);
     memcpy(K1 + inputPasswordLength + KLength, userKey, userKeyLength);
     for(int i = 1; i < 64 ; ++i) {


More information about the poppler mailing list