From: so.yu Date: Tue, 25 Jun 2013 00:45:30 +0000 (+0900) Subject: Fix the prevent issue - #38349 X-Git-Tag: submit/tizen_2.2/20130714.152805~73^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec35e4d7dee39a9929a0f02fdaf86b8e1d311bfd;p=framework%2Fosp%2Fappfw.git Fix the prevent issue - #38349 Change-Id: I9cd44771aae962d4f6f976e3e4bc1107171a977c Signed-off-by: so.yu --- diff --git a/src/security/cert/FSecCert_CertDbManager.cpp b/src/security/cert/FSecCert_CertDbManager.cpp index 6d30d33..2f9886a 100755 --- a/src/security/cert/FSecCert_CertDbManager.cpp +++ b/src/security/cert/FSecCert_CertDbManager.cpp @@ -1792,6 +1792,7 @@ _CertDbManager::GetUserCertificateChain(char* pIssuerName, int issuerNameLen, ch else if (encodingType == _CERT_ENC_TYPE_BASE64) { int certLen = _Base64::GetEncodedSize(pCertList->length); + SysTryReturnResult(NID_SEC_CERT, certLen > 0, E_SYSTEM, "Certificate length is invalid."); memset(pCertList->certificate + pCertList->length, 0, sizeof(pCertList->certificate) - pCertList->length); r = _Base64::Encode(reinterpret_cast< byte* >(pCertList->certificate), pCertList->length, reinterpret_cast< char* >(pCertList->certificate), certLen); SysTryReturnResult(NID_SEC_CERT, !IsFailed(r), E_ENCODING_FAILED, "Failed to encode data in base 64 encoding.");