fix: fix cfg load enviroment variables crash when environ is NULL

This commit is contained in:
Ganlin Zhao 2023-03-27 15:41:50 +08:00
parent af53a3a226
commit 3c70008b4b
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;