Merge pull request #55 from matrix-org/dbkr/pk_key_length

Fix output buffer length check
poljar/cmake_sas
David Baker 2018-09-20 11:30:27 +01:00 committed by GitHub
commit d6cd18df40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ size_t olm_pk_generate_key(
void * pubkey, size_t pubkey_length,
void * random, size_t random_length
) {
if (pubkey_length < CURVE25519_KEY_LENGTH) {
if (pubkey_length < olm_pk_key_length()) {
decryption->last_error =
OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL;
return std::size_t(-1);