From 08fd3ba492333d94256929ccf52d7eebf9eca134 Mon Sep 17 00:00:00 2001 From: Austin Yuan Date: Thu, 27 Dec 2012 18:00:30 +0800 Subject: va_parseConfig: still need to check env_value env_value may be NULL which means the caller doens't care the value of the environment variable, just check if it is set. Signed-off-by: Austin Yuan (cherry picked from commit 2e11d2273b2974a7d1959cbcaf8db5b8e9aedd9e) --- va/va.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'va') diff --git a/va/va.c b/va/va.c index 6210112..8031092 100644 --- a/va/va.c +++ b/va/va.c @@ -88,7 +88,8 @@ int va_parseConfig(char *env, char *env_value) /* no setting in config file, use env setting */ value = getenv(env); if (value) { - strncpy(env_value, value, 1024); + if (env_value) + strncpy(env_value, value, 1024); return 0; } -- cgit v1.2.3