From: Woongsuk Date: Mon, 10 Mar 2025 00:24:47 +0000 (+0900) Subject: Fix coverity issue X-Git-Tag: accepted/tizen/unified/20250310.131221^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b07c795837c50feb359630705a51f41c0c904c9;p=platform%2Fcore%2Fdotnet%2Flauncher.git Fix coverity issue add null check before creating string --- diff --git a/NativeLauncher/launcher/exec/corerun.cc b/NativeLauncher/launcher/exec/corerun.cc index 887912b..9b7f1d7 100644 --- a/NativeLauncher/launcher/exec/corerun.cc +++ b/NativeLauncher/launcher/exec/corerun.cc @@ -136,9 +136,11 @@ int main(int argc, const char* argv[]) { } // Implicit compatibility mode for System.CommandLine. - std::string termValue(getenv("TERM")); - if (termValue == "linux") { - setenv("TERM", "xterm", 1); + char* termValue = getenv("TERM"); + if (termValue) { + if (strcmp(termValue, "linux") == 0) { + setenv("TERM", "xterm", 1); + } } argc--;