fixed NULL dereference

This commit is contained in:
Frank Morgner 2018-08-23 09:51:04 +02:00
parent 45f407c021
commit 67fbf15741
1 changed files with 7 additions and 5 deletions

View File

@ -178,11 +178,13 @@ sc_ctx_win32_get_config_value(const char *name_env,
if (name_env) {
char *value = value = getenv(name_env);
if (strlen(value) < *out_len)
return SC_ERROR_NOT_ENOUGH_MEMORY;
memcpy(out, value, strlen(value));
*out_len = strlen(value);
return SC_SUCCESS;
if (value) {
if (strlen(value) < *out_len)
return SC_ERROR_NOT_ENOUGH_MEMORY;
memcpy(out, value, strlen(value));
*out_len = strlen(value);
return SC_SUCCESS;
}
}
if (!name_reg)