Commit 68c59779 authored by Albert Astals Cid's avatar Albert Astals Cid

BaseCryptStream: Initialize all of objKey

fixes oss-fuzz/8493
parent 14adecb9
......@@ -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))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment