check size before reading
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user