Fix prevent issue
authorDuyoung Jang <duyoung.jang@samsung.com>
Wed, 12 Jun 2013 01:12:23 +0000 (10:12 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Wed, 12 Jun 2013 01:12:23 +0000 (10:12 +0900)
Change-Id: Id383ce864c97615e90cc67c2a4e33e5a29a0451a
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
src/Util/InstallerUtil.cpp

index 4f9f787..74d0952 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130611.2]"
+#define OSP_INSTALLER_VERSION "version=[20130612.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 72219c3..73ca8cb 100755 (executable)
@@ -377,6 +377,9 @@ InstallerUtil::IsDrmFile(const String& path)
        char* pErrorMsg = null;
        int (*drm_oem_sapps_is_drm_file)(const char* pDcfPath, int dcfPathLen);
 
+       std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(path));
+       TryReturn(pFilePath, false, "pFilePath is null.");
+
        pHandle = dlopen("/usr/lib/libdrm-service-core-sapps.so.0", RTLD_LAZY | RTLD_GLOBAL);
        if (!pHandle)
        {
@@ -393,9 +396,6 @@ InstallerUtil::IsDrmFile(const String& path)
                return false;
        }
 
-       std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(path));
-       TryReturn(pFilePath, false, "pFilePath is null.");
-
        AppLog("[drm] drm_oem_sapps_is_drm_file(%s, %d)", pFilePath.get(), strlen(pFilePath.get()));
        ret = drm_oem_sapps_is_drm_file(pFilePath.get(), strlen(pFilePath.get()));
        AppLog("[drm] drm_oem_sapps_is_drm_file(), result = [%d]", ret);
@@ -421,6 +421,12 @@ InstallerUtil::DecryptPackage(const String& path, const String& decryptedPath)
        char* pErrorMsg = null;
        int (*drm_oem_sapps_decrypt_package)(const char* pDcfPath, int dcfPathLen, const char* pDecryptedFile, int decryptedFileLen);
 
+       std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(path));
+       TryReturn(pFilePath, false, "pFilePath is null.");
+
+       std::unique_ptr<char[]> pDecryptedPath(_StringConverter::CopyToCharArrayN(decryptedPath));
+       TryReturn(pDecryptedPath, false, "pDecryptedPath is null.");
+
        pHandle = dlopen("/usr/lib/libdrm-service-core-sapps.so.0", RTLD_LAZY | RTLD_GLOBAL);
        if (!pHandle)
        {
@@ -437,12 +443,6 @@ InstallerUtil::DecryptPackage(const String& path, const String& decryptedPath)
                return false;
        }
 
-       std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(path));
-       TryReturn(pFilePath, false, "pFilePath is null.");
-
-       std::unique_ptr<char[]> pDecryptedPath(_StringConverter::CopyToCharArrayN(decryptedPath));
-       TryReturn(pDecryptedPath, false, "pDecryptedPath is null.");
-
        AppLog("[drm] drm_oem_sapps_decrypt_package(%s, %d, %s, %d)", pFilePath.get(), strlen(pFilePath.get()), pDecryptedPath.get(), strlen(pDecryptedPath.get()));
        ret = drm_oem_sapps_decrypt_package(pFilePath.get(), strlen(pFilePath.get()), pDecryptedPath.get(), strlen(pDecryptedPath.get()));
        AppLog("[drm] drm_oem_sapps_decrypt_package(), result = [%d]", ret);