macCore: Don't pass NULL or "" into getenv()

This commit is contained in:
Andrew Johnson
2021-11-22 15:56:30 -06:00
parent 631f514c7c
commit 31fcb77412

View File

@@ -588,7 +588,7 @@ static MAC_ENTRY *lookup( MAC_HANDLE *handle, const char *name, int special )
}
if ( (special == FALSE) && (entry == NULL) &&
(handle->flags & FLAG_USE_ENVIRONMENT) ) {
char *value = getenv(name);
char *value = name && *name ? getenv(name) : NULL;
if (value) {
entry = create( handle, name, FALSE );
if ( entry ) {