From 6ba4473fb757e7606a4224d87774294c9d60d2cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Beh=C3=BAn?= Date: Sun, 17 Oct 2021 17:36:33 +0200 Subject: [PATCH] env: Don't match empty variable name in env_match() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Do we really allow zero-length variable name? I guess not. Signed-off-by: Marek Behún Reviewed-by: Simon Glass --- cmd/nvedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 5b1d4c2448..8d53579d92 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -708,7 +708,7 @@ char *from_env(const char *envvar) static const char *env_match(const char *p, const char *s1) { - if (s1 == NULL) + if (s1 == NULL || *s1 == '\0') return NULL; while (*s1 == *p++) -- 2.39.5