commit | 2906969dd45ec59228062aeab3dec7ec2fc85a62 | [log] [tgz] |
---|---|---|
author | Marek BehĂșn <marek.behun@nic.cz> | Sun Oct 17 17:36:33 2021 +0200 |
committer | Simon Glass <sjg@chromium.org> | Thu Oct 21 12:50:48 2021 -0600 |
tree | 32ad464afe34d94d7917b6a2073ea434f97bcfd1 | |
parent | 26efbe307eb841964635dbec7a99a8ff807f0ae3 [diff] |
env: Don't match empty variable name in env_match() Do we really allow zero-length variable name? I guess not. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 5b1d4c2..8d53579 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c
@@ -708,7 +708,7 @@ static const char *env_match(const char *p, const char *s1) { - if (s1 == NULL) + if (s1 == NULL || *s1 == '\0') return NULL; while (*s1 == *p++)