From 54bed650e464dbb14fd9e006c85ec84b0e6e471e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 20 May 2005 01:02:56 +0000 Subject: [PATCH] check size before reading --- stepmania/src/CryptManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stepmania/src/CryptManager.cpp b/stepmania/src/CryptManager.cpp index 39ab88386e..2b702d3ebd 100644 --- a/stepmania/src/CryptManager.cpp +++ b/stepmania/src/CryptManager.cpp @@ -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);