Merge pull request #2850 from JacobBarthelmeh/SanityChecks

sanity check on IV size
pull/2851/head
toddouska 2020-03-16 09:36:17 -07:00 committed by GitHub
commit 321a43edee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -10220,6 +10220,8 @@ int wc_EncryptedInfoParse(EncryptedInfo* info, char** pBuffer, size_t bufSz)
}
if ((newline != NULL) && (newline > finish)) {
info->ivSz = (word32)(newline - (finish + 1));
if (info->ivSz >= IV_SZ)
return BUFFER_E;
if (XMEMCPY(info->iv, finish + 1, info->ivSz) == NULL)
return BUFFER_E;
info->set = 1;