From 2d823dfaee1f3fe329f5b2eaf79eb3d9c27943a9 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 30 Sep 2006 05:58:55 +0000 Subject: In the keypair consistency check for encryption/decryption keys, a key that was very small (with max_input_size() == 0) would underflow and cause an attempted allocation of a 4 gigabyte input string. --- src/keypair.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/keypair.cpp b/src/keypair.cpp index 11ddbd811..eb613b971 100644 --- a/src/keypair.cpp +++ b/src/keypair.cpp @@ -17,6 +17,9 @@ namespace KeyPair { *************************************************/ void check_key(PK_Encryptor* encryptor, PK_Decryptor* decryptor) { + if(encryptor->maximum_input_size() == 0) + return; + std::auto_ptr enc(encryptor); std::auto_ptr dec(decryptor); -- cgit v1.2.3