Fixed execve EFAULT error on the asan environment. 02/89602/1
authorKim Gunsoo <gunsoo83.kim@samsung.com>
Mon, 26 Sep 2016 06:21:56 +0000 (15:21 +0900)
committerKim Gunsoo <gunsoo83.kim@samsung.com>
Mon, 26 Sep 2016 06:32:49 +0000 (15:32 +0900)
- the envp array of pointers must be terminated by a NULL pointer.

Change-Id: Ieb64b20c1fdf24aec16ae248faf051889ddb76d4
Signed-off-by: Kim Gunsoo <gunsoo83.kim@samsung.com>
src/services.c

index 2fbcaa7..6fe6b71 100644 (file)
@@ -597,9 +597,12 @@ static int create_subproc_thread(const char *name, int lines, int columns)
     char *value = NULL;
     char *trim_value = NULL;
     char path[PATH_MAX];
-    memset(path, 0, sizeof(path));
     char *envp[MAX_TOKENS];
     int envp_cnt = 0;
+
+    memset(path, 0, sizeof(path));
+    memset(envp, 0, sizeof(envp));
+
     envp[envp_cnt++] = strdup("TERM=linux");
     envp[envp_cnt++] = strdup("DISPLAY=:0");