Merge pull request #20653 from taosdata/fix/TS-2987

fix: fix cfg load enviroment variables crash when environ is NULL
This commit is contained in:
dapan1121 2023-03-27 18:50:13 +08:00 committed by GitHub
commit ad0505b2ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -637,6 +637,8 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) {
int32_t code = 0;
char **pEnv = environ;
line[1023] = 0;
if (pEnv == NULL) return 0;
while (*pEnv != NULL) {
name = value = value2 = value3 = NULL;
olen = vlen = vlen2 = vlen3 = 0;