From 4c33c56a40de04d4edd713f723e5716cb7a771f0 Mon Sep 17 00:00:00 2001 From: "sung-su.kim" Date: Thu, 17 Oct 2013 21:33:43 +0900 Subject: [PATCH] Fix prevent issue [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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index 829bc8f..188bf04 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -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); -- 2.7.4