poppler/Decrypt.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 68c5977980a60b2fbac0a5938e697cf09f37b0a2 Author: Albert Astals Cid <[email protected]> Date: Fri May 25 23:06:53 2018 +0200 BaseCryptStream: Initialize all of objKey fixes oss-fuzz/8493 diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc index 2e599bcd..9577b655 100644 --- a/poppler/Decrypt.cc +++ b/poppler/Decrypt.cc @@ -311,14 +311,16 @@ BaseCryptStream::BaseCryptStream(Stream *strA, Guchar *fileKey, CryptAlgorithm a int keyLength, int objNum, int objGen): FilterStream(strA) { - int i; - algo = algoA; // construct object key - for (i = 0; i < keyLength; ++i) { + for (int i = 0; i < keyLength; ++i) { objKey[i] = fileKey[i]; } + for (std::size_t i = keyLength; i < sizeof(objKey); ++i) { + objKey[i] = 0; + } + switch (algo) { case cryptRC4: if (likely(keyLength < static_cast<int>(sizeof(objKey) - 4))) { _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
