From 31fcb77412616a4d015e170957df3d9c37c7f7d3 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 22 Nov 2021 15:56:30 -0600 Subject: [PATCH] macCore: Don't pass NULL or "" into getenv() --- modules/libcom/src/macLib/macCore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/macLib/macCore.c b/modules/libcom/src/macLib/macCore.c index 7c3cf0690..ee511d6ab 100644 --- a/modules/libcom/src/macLib/macCore.c +++ b/modules/libcom/src/macLib/macCore.c @@ -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 ) {