Modify inappropriately implemented string sanitize function 45/178545/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 10 May 2018 09:54:31 +0000 (18:54 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 10 May 2018 09:54:31 +0000 (18:54 +0900)
Change-Id: If901be3782bbbfb4e65a3c99b4c356e6057cc5f0

ism/src/scim_helper_launcher.cpp

index ad720f2..d27da7c 100644 (file)
 
 using namespace scim;
 
-static String sanitize_string (const char *str, int maxlen = 32)
+static String sanitize_path_string (const char *str, int maxlen = 256)
 {
     String ret;
     static char acceptables[] =
         "abcdefghijklmnopqrstuvwxyz"
         "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-        "1234567890_-.@:";
+        "1234567890_-.@:/";
 
     char *newstr = NULL;
     if (maxlen > 0) {
@@ -159,7 +159,7 @@ int main (int argc, char *argv [])
                 std::cerr << "No argument for option " << argv [i-1] << "\n";
                 return -1;
             }
-            DebugOutput::set_output (sanitize_string (argv [i]));
+            DebugOutput::set_output (sanitize_path_string (argv [i]));
             continue;
         }
 
@@ -174,7 +174,7 @@ int main (int argc, char *argv [])
         }
     }
 
-    String exec = sanitize_string (argv[0]);
+    String exec = sanitize_path_string (argv[0]);
 
     if (exec != String (SCIM_HELPER_LAUNCHER_PROGRAM)) {
         /* 3rd party shared object type IME */