Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Crypto/Rar5Aes.cpp')
-rw-r--r--CPP/7zip/Crypto/Rar5Aes.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/CPP/7zip/Crypto/Rar5Aes.cpp b/CPP/7zip/Crypto/Rar5Aes.cpp
index dc1f4ce6..005fa6bc 100644
--- a/CPP/7zip/Crypto/Rar5Aes.cpp
+++ b/CPP/7zip/Crypto/Rar5Aes.cpp
@@ -30,14 +30,13 @@ CDecoder::CDecoder(): CAesCbcDecoder(kAesKeySize) {}
static unsigned ReadVarInt(const Byte *p, unsigned maxSize, UInt64 *val)
{
- unsigned i;
*val = 0;
- for (i = 0; i < maxSize;)
+ for (unsigned i = 0; i < maxSize && i < 10;)
{
Byte b = p[i];
- if (i < 10)
- *val |= (UInt64)(b & 0x7F) << (7 * i++);
+ *val |= (UInt64)(b & 0x7F) << (7 * i);
+ i++;
if ((b & 0x80) == 0)
return i;
}