Fix prevent issue
authorsung-su.kim <sung-su.kim@samsung.com>
Thu, 17 Oct 2013 12:33:43 +0000 (21:33 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Wed, 23 Oct 2013 14:35:25 +0000 (23:35 +0900)
[Issue#]   CID:21193
[Problem]  Use of untrusted string value
[Cause]    Return null value in getenv function
[Solution] If getenv return null value, set empty string

[Verification] Build repository

Change-Id: I91d797c15d49a331c8fa9baaf43fce798ae057ef

src/wrt-client/wrt-client.cpp

index 829bc8f..188bf04 100644 (file)
@@ -1039,6 +1039,10 @@ int main(int argc,
             // This change is needed for getting elementary profile
             // /opt/home/app/.elementary/config/mobile/base.cfg
             const char* backupEnv = getenv(HOME);
+            if (!backupEnv) {
+                // If getenv return "NULL", set empty string
+                backupEnv = "";
+            }
             setenv(HOME, APP_HOME_PATH, 1);
             LogDebug("elm_init()");
             elm_init(argc, argv);