Merge pull request from libtom/fix/coverity-cbc_decrypt-out-of-bounds-read

fix coverity finding: cbc_decrypt out-of-bound read
This commit is contained in:
karel-m 2017-02-25 20:44:47 +01:00 committed by GitHub
commit d777f9d1dc

View File

@ -45,7 +45,7 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s
}
/* is blocklen valid? */
if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) {
if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV) || cbc->blocklen > (int)sizeof(tmp)) {
return CRYPT_INVALID_ARG;
}