From: Kim Gunsoo Date: Mon, 26 Sep 2016 06:21:56 +0000 (+0900) Subject: Fixed execve EFAULT error on the asan environment. X-Git-Tag: submit/tizen/20160930.063257~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f64f2f8e369cb60aa96fd90193c7438043738a7;p=sdk%2Ftarget%2Fsdbd.git Fixed execve EFAULT error on the asan environment. - the envp array of pointers must be terminated by a NULL pointer. Change-Id: Ieb64b20c1fdf24aec16ae248faf051889ddb76d4 Signed-off-by: Kim Gunsoo --- diff --git a/src/services.c b/src/services.c index 2fbcaa7..6fe6b71 100644 --- a/src/services.c +++ b/src/services.c @@ -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");