check size before reading

This commit is contained in:
Glenn Maynard
2005-05-20 01:02:56 +00:00
parent 1cc8495a26
commit 54bed650e4
+4 -4
View File
@@ -184,14 +184,14 @@ bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CS
if( !GetFileContents(sPublicKeyFile, sPublicKey) )
return false;
CString sSignature;
if( !GetFileContents(sSignatureFile, sSignature) )
return false;
int iBytes = FILEMAN->GetFileSizeInBytes( sSignatureFile );
if( iBytes > MAX_SIGNATURE_SIZE_BYTES )
return false;
CString sSignature;
if( !GetFileContents(sSignatureFile, sSignature) )
return false;
try {
StringSource pubFile( sPublicKey, true );
RSASSA_PKCS1v15_SHA_Verifier pub(pubFile);