summaryrefslogtreecommitdiff
path: root/src/Manager
diff options
context:
space:
mode:
authorDongeup Ham <dongeup.ham@samsung.com>2012-12-27 13:58:15 +0900
committerDongeup Ham <dongeup.ham@samsung.com>2012-12-27 13:58:15 +0900
commiteb04667e6caaf20a7016ec9122ba9b54a2ed7b2d (patch)
tree669bbb9a4fad38b1252dc8da3caa6d08df0f1589 /src/Manager
parent7111af69a59fcfebeef7248b96f76c6e8f0a1eac (diff)
downloadinstaller-eb04667e6caaf20a7016ec9122ba9b54a2ed7b2d.tar.gz
installer-eb04667e6caaf20a7016ec9122ba9b54a2ed7b2d.tar.bz2
installer-eb04667e6caaf20a7016ec9122ba9b54a2ed7b2d.zip
Prevent issues are fixed.
Change-Id: I2fb8620fa55a66b3cfca69bc42837bf305bdb1f3 Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
Diffstat (limited to 'src/Manager')
-rwxr-xr-xsrc/Manager/ConfigurationManager.cpp14
-rwxr-xr-x[-rw-r--r--]src/Manager/InstallerManager.cpp16
-rwxr-xr-x[-rw-r--r--]src/Manager/SignatureManager.cpp10
3 files changed, 21 insertions, 19 deletions
diff --git a/src/Manager/ConfigurationManager.cpp b/src/Manager/ConfigurationManager.cpp
index 65bf975..95f08c1 100755
--- a/src/Manager/ConfigurationManager.cpp
+++ b/src/Manager/ConfigurationManager.cpp
@@ -469,17 +469,19 @@ CATCH:
char*
ConfigurationManager::GetCertValueN(ICertificate* pCert) const
{
- bool result = true;
+ result r = E_SUCCESS;
ByteBuffer* pEncodedData = null;
String base64Value;
char* pEncodedValue = null;
pEncodedData = pCert->GetEncodedDataN();
- TryCatch(pEncodedData, result = false, "[osp-installer] pEncodedData is null.");
+ TryCatch(pEncodedData, , "[osp-installer] pEncodedData is null.");
+
+ r = StringUtil::EncodeToBase64String(*pEncodedData, base64Value);
+ TryCatch(!IsFailed(r), , "[osp-installer] StringUtil::EncodeToBase64String is failed.");
- StringUtil::EncodeToBase64String(*pEncodedData, base64Value);
pEncodedValue = _StringConverter::CopyToCharArrayN(base64Value);
- TryCatch(pEncodedValue, result = false, "[osp-installer] pEncodedValue is null");
+ TryCatch(pEncodedValue, , "[osp-installer] pEncodedValue is null");
CATCH:
delete pEncodedData;
@@ -659,7 +661,7 @@ ConfigurationManager::MergeToSystemXmlFile(const String& systemXmlPath, const St
r = webXml.Construct(webXmlPath, L"r");
TryReturn(!IsFailed(r), false, "[osp-installer] webXmlPath.Construct is failed");
- std::unique_ptr<char[]> pMergedBuf(new char[mergedSize + 1]);
+ std::unique_ptr<char[]> pMergedBuf(new (std::nothrow) char[mergedSize + 1]);
TryReturn(pMergedBuf, false, "[osp-installer] pMergedBuf is null");
memset(pMergedBuf.get(), 0, mergedSize + 1);
@@ -670,7 +672,7 @@ ConfigurationManager::MergeToSystemXmlFile(const String& systemXmlPath, const St
r = serviceXml.Construct(serviceXmlPath, L"r");
TryReturn(!IsFailed(r), false, "[osp-installer] serviceXmlPath.Construct is failed");
- std::unique_ptr<char[]> pServiceBuf(new char[serviceXmlFileSize + 1]);
+ std::unique_ptr<char[]> pServiceBuf(new (std::nothrow) char[serviceXmlFileSize + 1]);
TryReturn(pServiceBuf, false, "[osp-installer] pServiceBuf is null");
memset(pServiceBuf.get(), 0, serviceXmlFileSize + 1);
diff --git a/src/Manager/InstallerManager.cpp b/src/Manager/InstallerManager.cpp
index 723fbac..368a505 100644..100755
--- a/src/Manager/InstallerManager.cpp
+++ b/src/Manager/InstallerManager.cpp
@@ -163,37 +163,37 @@ InstallerManager::CreateInstaller(InstallerType installerType)
{
case INSTALLER_TYPE_INSTALLER:
AppLogTag(OSP_INSTALLER, "InstallerType = [Installer]");
- pInstaller = new Installer();
+ pInstaller = new (std::nothrow) Installer();
break;
case INSTALLER_TYPE_PACKAGE:
AppLogTag(OSP_INSTALLER, "InstallerType = [PackageInstaller]");
- pInstaller = new PackageInstaller();
+ pInstaller = new (std::nothrow) PackageInstaller();
break;
case INSTALLER_TYPE_DIRECTORY:
AppLogTag(OSP_INSTALLER, "InstallerType = [DirectoryInstaller]");
- pInstaller = new DirectoryInstaller();
+ pInstaller = new (std::nothrow) DirectoryInstaller();
break;
case INSTALLER_TYPE_GUEST:
AppLogTag(OSP_INSTALLER, "InstallerType = [GuestInstaller]");
- pInstaller = new GuestInstaller();
+ pInstaller = new (std::nothrow) GuestInstaller();
break;
case INSTALLER_TYPE_PRELOADED:
AppLogTag(OSP_INSTALLER, "InstallerType = [PreloadedInstaller]");
- pInstaller = new PreloadedInstaller();
+ pInstaller = new (std::nothrow) PreloadedInstaller();
break;
case INSTALLER_TYPE_IDE:
AppLogTag(OSP_INSTALLER, "InstallerType = [IDEInstaller]");
- pInstaller = new IDEInstaller();
+ pInstaller = new (std::nothrow) IDEInstaller();
break;
case INSTALLER_TYPE_RESTORATION:
AppLogTag(OSP_INSTALLER, "InstallerType = [RestorationInstaller]");
- pInstaller = new RestorationInstaller();
+ pInstaller = new (std::nothrow) RestorationInstaller();
break;
default:
@@ -373,7 +373,7 @@ InstallerManager::RequestRecursiveDirectory(const Tizen::Base::String& path, int
int successCount = 0;
int failureCount = 0;
- pDir = new Directory; // Allocate %Directory instance
+ pDir = new (std::nothrow) Directory; // Allocate %Directory instance
TryCatch(pDir, res = false, "[osp-installer] pDir is null");
r = pDir->Construct(path);
diff --git a/src/Manager/SignatureManager.cpp b/src/Manager/SignatureManager.cpp
index 2a43186..2d37017 100644..100755
--- a/src/Manager/SignatureManager.cpp
+++ b/src/Manager/SignatureManager.cpp
@@ -62,7 +62,7 @@ SignatureManager::SetSignature()
char* pSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetSignatureXmlPath());
char* pAuthorSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetAuthorSignatureXmlPath());
- __pDistributorSignature = new SignatureHandler;
+ __pDistributorSignature = new (std::nothrow) SignatureHandler;
TryCatch(__pDistributorSignature, ret = false, "[osp-installer] __pDistributorSignature is null");
ret = __pDistributorSignature->Construct(__pContext);
@@ -71,7 +71,7 @@ SignatureManager::SetSignature()
ret = __pDistributorSignature->Parse(pSignaturePath);
TryCatch(ret == true, ret = false, "[osp-installer] __pDistributorSignature->Parse is failed.");
- __pAuthorSignature = new SignatureHandler;
+ __pAuthorSignature = new (std::nothrow) SignatureHandler;
TryCatch(__pAuthorSignature, ret = false, "[osp-installer] __pAuthorSignature is null");
ret = __pAuthorSignature->Construct(__pContext);
@@ -100,7 +100,7 @@ SignatureManager::AddCert()
{
AppLogTag(OSP_INSTALLER, "AddCertificate - AuthorCertChain");
- __pAuthorCertPath = new X509CertificatePath();
+ __pAuthorCertPath = new (std::nothrow) X509CertificatePath();
TryCatch(__pAuthorCertPath, ret = false, "[osp-installer] __pAuthorCertPath is null.");
ret = AddCertificate(__pAuthorCertPath, pAuthorCertChain);
@@ -114,7 +114,7 @@ SignatureManager::AddCert()
{
AppLogTag(OSP_INSTALLER, "AddCertificate - DistributorCert");
- __pDistributorCertPath = new X509CertificatePath();
+ __pDistributorCertPath = new (std::nothrow) X509CertificatePath();
TryCatch(__pDistributorCertPath, ret = false, "[osp-installer] __pDistributorCertPath is null.");
ret = AddCertificate(__pDistributorCertPath, pDistributorCertChain);
@@ -210,7 +210,7 @@ SignatureManager::AddCertificate(X509CertificatePath* pCertPath, IList* pCertCha
{
AppLogTag(OSP_INSTALLER, "[cert][%d]", i);
- pCertificate = new X509Certificate;
+ pCertificate = new (std::nothrow) X509Certificate;
TryCatch(pCertificate, ret = false, "[osp-installer] pCertificate is null.");
r = pCertificate->Construct(*pByteBuffer);